diff --git a/trunk/.classpath b/trunk/.classpath index 77a3b804..07ffbb30 100644 --- a/trunk/.classpath +++ b/trunk/.classpath @@ -28,12 +28,10 @@ - - @@ -42,5 +40,7 @@ + + diff --git a/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java b/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java index 3a3c69b3..06c93120 100644 --- a/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java +++ b/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java @@ -93,20 +93,20 @@ public class SIPRPDataLoader implements CompanyDataLoader // Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" ); // Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" ); // - Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" ); - Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" ); - Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" ); - Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" ); - Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" ); - Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" ); - // Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" ); // Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" ); // Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" ); -// Singleton.setInstance( SingletonConstants.LOCAL_URL, "dbserver:5432" ); -// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local3" ); +// Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" ); +// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" ); // Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" ); + Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" ); + Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" ); + Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" ); + Singleton.setInstance( SingletonConstants.LOCAL_URL, "dbserver:5432" ); + Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local3" ); + Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" ); + // // Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" ); // Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java index 2a8c7900..e34e208c 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/AdicionarPanel.java @@ -18,6 +18,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; public abstract class AdicionarPanel extends JPanel { @@ -38,7 +39,7 @@ public abstract class AdicionarPanel extends JPanel protected final DefaultTreeModel model = new DefaultTreeModel( root ); - protected final JTree tree = new JTree( model ); + protected final LeafTree tree = new LeafTree( model ); protected final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java index 7822f64d..ae667cb3 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/AdicionarEquipamentosPanel.java @@ -22,6 +22,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; import leaf.ui.TreeInserterDialog; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.HsEquipamento; @@ -49,7 +50,7 @@ public class AdicionarEquipamentosPanel extends JPanel private final DefaultTreeModel model = new DefaultTreeModel( root ); - public final JTree tree = new JTree( model ); + public final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/GerirEquipamentosPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/GerirEquipamentosPanel.java index e2b65f3d..fb7c6ee8 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/GerirEquipamentosPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/equipamentos/GerirEquipamentosPanel.java @@ -29,6 +29,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; import leaf.ui.LeafUIConstants; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.HsEquipamento; @@ -63,7 +64,7 @@ public class GerirEquipamentosPanel extends JPanel implements CaretListener, Lea private final DefaultTreeModel model = new DefaultTreeModel( root ); - private final JTree tree = new JTree( model ); + private final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/legislacao/GerirLegislacaoPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/legislacao/GerirLegislacaoPanel.java index 97297151..0e966ccc 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/legislacao/GerirLegislacaoPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/legislacao/GerirLegislacaoPanel.java @@ -31,6 +31,7 @@ import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; import leaf.ui.LeafTextAreaEditor; +import leaf.ui.LeafTree; import leaf.ui.LeafUIConstants; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.HsLegislacao; @@ -70,7 +71,7 @@ public class GerirLegislacaoPanel extends JPanel implements LeafUIConstants private final DefaultTreeModel modelGeral = new DefaultTreeModel( rootGeral ); - private final JTree treeGeral = new JTree( modelGeral ); + private final LeafTree treeGeral = new LeafTree( modelGeral ); private final JScrollPane scrollGeral = new JScrollPane( treeGeral ); @@ -78,7 +79,7 @@ public class GerirLegislacaoPanel extends JPanel implements LeafUIConstants private final DefaultTreeModel modelCategorias = new DefaultTreeModel( rootCategorias ); - private final JTree treeCategorias = new JTree( modelCategorias ); + private final LeafTree treeCategorias = new LeafTree( modelCategorias ); private final JScrollPane scrollCategorias = new JScrollPane( treeCategorias ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/normalizacao/GerirNormalizacaoPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/normalizacao/GerirNormalizacaoPanel.java index c6d60e16..6f2217e4 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/normalizacao/GerirNormalizacaoPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/normalizacao/GerirNormalizacaoPanel.java @@ -37,6 +37,7 @@ import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; import leaf.ui.LeafTextAreaEditor; +import leaf.ui.LeafTree; import leaf.ui.LeafUIConstants; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.HsNormalizacao; @@ -75,7 +76,7 @@ public class GerirNormalizacaoPanel extends JPanel implements LeafUIConstants, C private final DefaultTreeModel modelPortuguesa = new DefaultTreeModel( rootPortuguesa ); - private final JTree treePortuguesa = new JTree( modelPortuguesa ); + private final LeafTree treePortuguesa = new LeafTree( modelPortuguesa ); private final JScrollPane scrollPortuguesa = new JScrollPane( treePortuguesa ); @@ -83,7 +84,7 @@ public class GerirNormalizacaoPanel extends JPanel implements LeafUIConstants, C private final DefaultTreeModel modelInternacional = new DefaultTreeModel( rootInternacional ); - private final JTree treeInternacional = new JTree( modelInternacional ); + private final LeafTree treeInternacional = new LeafTree( modelInternacional ); private final JScrollPane scrollInternacional = new JScrollPane( treeInternacional ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/AdicionarAreasPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/AdicionarAreasPanel.java index 02f3fd27..a02804ec 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/AdicionarAreasPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/AdicionarAreasPanel.java @@ -20,6 +20,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; import leaf.ui.TreeInserterDialog; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.Estabelecimentos; @@ -48,7 +49,7 @@ public class AdicionarAreasPanel extends JPanel private final DefaultTreeModel model = new DefaultTreeModel( root ); - public final JTree tree = new JTree( model ); + public final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/GerirAreasPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/GerirAreasPanel.java index 73ae3edc..fd3189bb 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/GerirAreasPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/postos/GerirAreasPanel.java @@ -34,6 +34,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; import leaf.ui.LeafUIConstants; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.Empresas; @@ -69,7 +70,7 @@ public class GerirAreasPanel extends JPanel implements LeafUIConstants private final DefaultTreeModel model = new DefaultTreeModel( root ); - public final JTree tree = new JTree( model ); + public final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/AdicionarRiscosPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/AdicionarRiscosPanel.java index ce094682..901616e3 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/AdicionarRiscosPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/AdicionarRiscosPanel.java @@ -21,6 +21,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; import leaf.ui.TreeInserterDialog; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.BaseObject; @@ -51,7 +52,7 @@ public class AdicionarRiscosPanel extends JPanel private final DefaultTreeModel model = new DefaultTreeModel( root ); - public final JTree tree = new JTree( model ); + public final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java index 79e22361..322aefeb 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/gestao/riscos/GerirRiscosPanel.java @@ -28,6 +28,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; import leaf.ui.LeafUIConstants; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.HsMedida; @@ -79,7 +80,7 @@ public class GerirRiscosPanel extends JPanel implements LeafUIConstants private final DefaultTreeModel model = new DefaultTreeModel( root ); - private final JTree tree = new JTree( model ); + private final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java index 1d3d6b85..d3e8c610 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/GerirMedidasRelatorioPanel.java @@ -30,6 +30,7 @@ import javax.swing.tree.TreeSelectionModel; import leaf.ui.LeafButton; import leaf.ui.LeafDialog; import leaf.ui.LeafIconButton; +import leaf.ui.LeafTree; import leaf.ui.TreeInserterDialog; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.BaseObject; @@ -67,7 +68,7 @@ public class GerirMedidasRelatorioPanel extends JPanel private final DefaultTreeModel model = new DefaultTreeModel( root ); - public final JTree tree = new JTree( model ); + public final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java index 42a0fa61..eefdd45b 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/VerAreasRelatorioPanel.java @@ -17,6 +17,7 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; +import leaf.ui.LeafTree; import leaf.ui.TreeTools; import siprp.database.cayenne.objects.HsRelatorio; import siprp.database.cayenne.objects.HsRelatorioPosto; @@ -35,7 +36,7 @@ public class VerAreasRelatorioPanel extends JPanel private final DefaultTreeModel model = new DefaultTreeModel( root ); - public final JTree tree = new JTree( model ); + public final LeafTree tree = new LeafTree( model ); private final JScrollPane scroll = new JScrollPane( tree ); diff --git a/trunk/SIPRPSoft/src/siprp/lembretes/marcacoes/MarcacoesDataProvider.java b/trunk/SIPRPSoft/src/siprp/lembretes/marcacoes/MarcacoesDataProvider.java index a564c3ea..bda51f2f 100755 --- a/trunk/SIPRPSoft/src/siprp/lembretes/marcacoes/MarcacoesDataProvider.java +++ b/trunk/SIPRPSoft/src/siprp/lembretes/marcacoes/MarcacoesDataProvider.java @@ -130,17 +130,20 @@ public class MarcacoesDataProvider // String trabalhador = ( String ) array.get( n, 4 ); String split[] = trabalhador.split( " " ); - trabalhador = split[ 0 ] + " " + ( split.length > 2 ? split[ 1 ].charAt( 0 ) + ". " : " " ) + - ( split.length > 1 ? split[ split.length - 1 ] : "" ); - String estabelecimento = ( String ) array.get( n, 5 ); - String empresa = ( String ) array.get( n, 6 ); - String str = "" + trabalhador + "" - + "
   " + "Ficha de aptid" + atilde + "o caduca a " + D_F.format( c.getTime() ) - + "
   " + descricao + "" - + "
   " + empresa.substring( 0, empresa.length() > 20 ? 20 : empresa.length() ) - + " / " + estabelecimento.substring( 0, estabelecimento.length() > 10 ? 10 : estabelecimento.length() ) - + ""; - lembretes[ n ] = new MappableObject( id, str ); + if( split != null && split.length > 1 && split[0] != null && split[0].length() > 0 && split[1] != null && split[1].length() > 0 ) + { + trabalhador = split[ 0 ] + " " + ( split.length > 2 ? split[ 1 ].charAt( 0 ) + ". " : " " ) + + ( split.length > 1 ? split[ split.length - 1 ] : "" ); + String estabelecimento = ( String ) array.get( n, 5 ); + String empresa = ( String ) array.get( n, 6 ); + String str = "" + trabalhador + "" + + "
   " + "Ficha de aptid" + atilde + "o caduca a " + D_F.format( c.getTime() ) + + "
   " + descricao + "" + + "
   " + empresa.substring( 0, empresa.length() > 20 ? 20 : empresa.length() ) + + " / " + estabelecimento.substring( 0, estabelecimento.length() > 10 ? 10 : estabelecimento.length() ) + + ""; + lembretes[ n ] = new MappableObject( id, str ); + } } return lembretes; } diff --git a/trunk/common/lib/ashwood-1.1.jar b/trunk/common/lib/ashwood-1.1.jar deleted file mode 100644 index 4c27b9a5..00000000 Binary files a/trunk/common/lib/ashwood-1.1.jar and /dev/null differ diff --git a/trunk/common/lib/ashwood-2.0.jar b/trunk/common/lib/ashwood-2.0.jar new file mode 100644 index 00000000..55fcc9b1 Binary files /dev/null and b/trunk/common/lib/ashwood-2.0.jar differ diff --git a/trunk/common/lib/cayenne-server-3.0M2.jar b/trunk/common/lib/cayenne-server-3.0M2.jar deleted file mode 100644 index 36e197fe..00000000 Binary files a/trunk/common/lib/cayenne-server-3.0M2.jar and /dev/null differ diff --git a/trunk/common/lib/cayenne-server-3.0M6.jar b/trunk/common/lib/cayenne-server-3.0M6.jar new file mode 100644 index 00000000..fdf0d056 Binary files /dev/null and b/trunk/common/lib/cayenne-server-3.0M6.jar differ diff --git a/trunk/common/src/leaf/ui/LeafTree.java b/trunk/common/src/leaf/ui/LeafTree.java index 63ad32db..ff53dfad 100644 --- a/trunk/common/src/leaf/ui/LeafTree.java +++ b/trunk/common/src/leaf/ui/LeafTree.java @@ -2,10 +2,11 @@ package leaf.ui; import java.util.Enumeration; import java.util.LinkedList; +import java.util.List; import javax.swing.JTree; +import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeModel; -import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; public class LeafTree extends JTree @@ -13,7 +14,7 @@ public class LeafTree extends JTree private static final long serialVersionUID = 1L; - + private final List expandedNodes = new LinkedList(); public LeafTree(TreeModel model) { @@ -22,26 +23,52 @@ public class LeafTree extends JTree public void saveExpansionState() { - TreePath treePath = new TreePath((TreeNode)getModel().getRoot()); + expandedNodes.clear(); + TreePath treePath = new TreePath(getRoot()); savePath( treePath ); } - public void savePath( TreePath treePath ) + private DefaultMutableTreeNode getRoot() + { + return (DefaultMutableTreeNode) getModel().getRoot(); + } + + private void savePath( TreePath treePath ) { - //TODO if( treePath != null ) { Enumeration expanded = getExpandedDescendants(treePath); if( expanded != null ) { - expanded.nextElement(); + while( expanded.hasMoreElements() ) + { + TreePath path = expanded.nextElement(); + if( path != null ) + { + Object leaf = path.getLastPathComponent(); + if( leaf instanceof DefaultMutableTreeNode ) + { + Object userObject = ((DefaultMutableTreeNode)leaf).getUserObject(); + if( userObject != null ) + { + expandedNodes.add(userObject); + } + } + } + savePath(path); + } } } } public void loadExpansionState() { - //TODO + for( Object userObject : expandedNodes ) + { + TreeTools.expandNodeForObject( userObject, this ); + } } + + } diff --git a/trunk/common/src/leaf/ui/TreeTools.java b/trunk/common/src/leaf/ui/TreeTools.java index 1b5373f9..b9af3f6a 100644 --- a/trunk/common/src/leaf/ui/TreeTools.java +++ b/trunk/common/src/leaf/ui/TreeTools.java @@ -51,6 +51,10 @@ public class TreeTools public static void refreshTree( JTree tree, DefaultMutableTreeNode node, boolean expand ) { + if( tree instanceof LeafTree ) + { + ((LeafTree)tree).saveExpansionState(); + } ((DefaultTreeModel) tree.getModel()).nodeStructureChanged( node ); if( expand ) { @@ -59,6 +63,10 @@ public class TreeTools tree.expandPath( tree.getPathForRow( i ) ); } } + if( tree instanceof LeafTree ) + { + ((LeafTree)tree).loadExpansionState(); + } } public static boolean userObjectExistsOn( Object object, DefaultMutableTreeNode on ) @@ -226,4 +234,25 @@ public class TreeTools return path; } + private static DefaultMutableTreeNode getRoot( JTree tree ) + { + return (DefaultMutableTreeNode) tree.getModel().getRoot(); + } + + public static void expandNodeForObject(Object userObject, JTree tree ) + { + DefaultMutableTreeNode on = getRoot( tree ); + DefaultMutableTreeNode found = findNodeWithUserObject(userObject, on); + if( found != null ) + { + TreePath path = getPathFor(found); + if( path != null ) + { + tree.expandPath( path ); + } + } + } + + + } diff --git a/trunk/common/src/siprp/database/cayenne/objects/BaseObject.java b/trunk/common/src/siprp/database/cayenne/objects/BaseObject.java index 4c6848fd..828ae534 100644 --- a/trunk/common/src/siprp/database/cayenne/objects/BaseObject.java +++ b/trunk/common/src/siprp/database/cayenne/objects/BaseObject.java @@ -4,6 +4,7 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.text.DateFormat; +import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.Locale; @@ -72,9 +73,27 @@ public class BaseObject extends CayenneDataObject implements Comparable ListgetNtoN( String relation, String toGet ) - { - List result = new LinkedList(); - for( BaseObject o : (List) super.readProperty(relation) ) - { - OBJ_CLASS toGetObj = (OBJ_CLASS) o.readProperty( toGet ); - if( null == toGetObj.readProperty( "deleted_date" ) ) - { - result.add(toGetObj); - } - } - return result; - } - @Override public Object readProperty(String propertyName) { return (propertyName != null && propertyName.endsWith("Array") ) ? getReferringObjects(propertyName) : super.readProperty(propertyName); diff --git a/trunk/common/src/siprp/database/cayenne/objects/HsRisco.java b/trunk/common/src/siprp/database/cayenne/objects/HsRisco.java index f8579dcd..a34d18ad 100644 --- a/trunk/common/src/siprp/database/cayenne/objects/HsRisco.java +++ b/trunk/common/src/siprp/database/cayenne/objects/HsRisco.java @@ -1,5 +1,7 @@ package siprp.database.cayenne.objects; +import java.util.Date; + import siprp.database.cayenne.objects.auto._HsRisco; public class HsRisco extends _HsRisco { diff --git a/trunk/common/src/siprp/database/cayenne/providers/PlanoActuacaoDAO.java b/trunk/common/src/siprp/database/cayenne/providers/PlanoActuacaoDAO.java index 94f5d7d7..280780a2 100644 --- a/trunk/common/src/siprp/database/cayenne/providers/PlanoActuacaoDAO.java +++ b/trunk/common/src/siprp/database/cayenne/providers/PlanoActuacaoDAO.java @@ -5,7 +5,9 @@ import java.util.LinkedList; import java.util.List; import org.apache.cayenne.DataObjectUtils; +import org.apache.cayenne.cache.QueryCache; import org.apache.cayenne.exp.ExpressionFactory; +import org.apache.cayenne.query.QueryCacheStrategy; import org.apache.cayenne.query.SelectQuery; import siprp.database.cayenne.objects.EmailPlanoDeActuacao;