Index: topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java diff -u topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java:1.2 topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java:1.3 --- topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java:1.2 Fri Jul 30 16:57:58 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/AbstractLazyEntity.java Fri Dec 17 16:13:51 2004 @@ -23,9 +23,9 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * - * Mise a jour: $Date: 2004/07/30 16:57:58 $ + * Mise a jour: $Date: 2004/12/17 16:13:51 $ * par : $Author: pineau $ */ @@ -44,17 +44,17 @@ protected TopiaContext context = null; protected String _topiaId_ = null; - protected String _version_ = null; + protected String _topiaVersion_ = null; protected TopiaEntity entity = null; public AbstractLazyEntity(TopiaContext context, String topiaId, String version) throws TopiaException { this.context = context; this._topiaId_ = topiaId; - this._version_ = version; + this._topiaVersion_ = version; } public AbstractLazyEntity(TopiaContext context, TopiaEntity entity) throws TopiaException { - this(context, entity.get_topiaId_(), entity.get_version_()); + this(context, entity.get_topiaId_(), entity.get_topiaVersion_()); this.entity = entity; } @@ -67,8 +67,8 @@ if(o instanceof TopiaEntity){ try{ String topiaId = ((TopiaEntity)o).get_topiaId_(); - String version = ((TopiaEntity)o).get_version_(); - return _topiaId_.equals(topiaId) && VersionNumberUtil.equals(_version_,version); + String version = ((TopiaEntity)o).get_topiaVersion_(); + return _topiaId_.equals(topiaId) && VersionNumberUtil.equals(_topiaVersion_,version); }catch(TopiaException eee){ throw new RuntimeException("Can't check equality", eee); } @@ -77,7 +77,7 @@ } public String toString(){ - return "Lazy " + _topiaId_ + "(version " + _version_ + ")"; + return "Lazy " + _topiaId_ + "(version " + _topiaVersion_ + ")"; } public boolean isLoaded(){ @@ -131,46 +131,46 @@ return _topiaId_; } - public String get_version_() throws TopiaException { - return _version_; + public String get_topiaVersion_() throws TopiaException { + return _topiaVersion_; } - public Date get_creationDate_() throws TopiaException { + public Date get_topiaCreationDate_() throws TopiaException { load(); - return entity.get_creationDate_(); + return entity.get_topiaCreationDate_(); } - public Date get_lastUpdateDate_() throws TopiaException { + public Date get_topiaLastUpdateDate_() throws TopiaException { load(); - return entity.get_lastUpdateDate_(); + return entity.get_topiaLastUpdateDate_(); } - public TopiaUser get_lastUpdateUser_() throws TopiaException { + public TopiaUser get_topiaLastUpdateUser_() throws TopiaException { load(); - return entity.get_lastUpdateUser_(); + return entity.get_topiaLastUpdateUser_(); } public void set_topiaId_(String v) throws TopiaException { throw new UnsupportedOperationException("It's not allow to change topiaId"); } - public void set_version_(String v) throws TopiaException { + public void set_topiaVersion_(String v) throws TopiaException { throw new UnsupportedOperationException("It's not allow to change version"); } - public void set_creationDate_(Date v) throws TopiaException { + public void set_topiaCreationDate_(Date v) throws TopiaException { load(); - entity.set_creationDate_(v); + entity.set_topiaCreationDate_(v); } - public void set_lastUpdateDate_(Date v) throws TopiaException { + public void set_topiaLastUpdateDate_(Date v) throws TopiaException { load(); - entity.set_lastUpdateDate_(v); + entity.set_topiaLastUpdateDate_(v); } - public void set_lastUpdateUser_(TopiaUser v) throws TopiaException { + public void set_topiaLastUpdateUser_(TopiaUser v) throws TopiaException { load(); - entity.set_lastUpdateUser_(v); + entity.set_topiaLastUpdateUser_(v); } Index: topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java diff -u topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java:1.3 topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java:1.4 --- topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java:1.3 Fri Sep 17 13:16:45 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/JDOEntity.java Fri Dec 17 16:13:51 2004 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * - * Mise a jour: $Date: 2004/09/17 13:16:45 $ - * par : $Author: mazelier $ + * Mise a jour: $Date: 2004/12/17 16:13:51 $ + * par : $Author: pineau $ */ package org.codelutin.topia.persistence.jdo; @@ -45,16 +45,16 @@ public Class getEntityClass(); public String get_topiaId_(); - public String get_version_(); - public Date get_creationDate_(); - public Date get_lastUpdateDate_(); - public TopiaUser get_lastUpdateUser_(); + public String get_topiaVersion_(); + public Date get_topiaCreationDate_(); + public Date get_topiaLastUpdateDate_(); + public TopiaUser get_topiaLastUpdateUser_(); public void set_topiaId_(String v); - public void set_version_(String v); - public void set_creationDate_(Date v); - public void set_lastUpdateDate_(Date v); - public void set_lastUpdateUser_(TopiaUser v); + public void set_topiaVersion_(String v); + public void set_topiaCreationDate_(Date v); + public void set_topiaLastUpdateDate_(Date v); + public void set_topiaLastUpdateUser_(TopiaUser v); public void update(TopiaEntity topiaEntity, HashSet done, PersistenceManager pm) throws TopiaException; public TopiaEntity convertToEntity() throws TopiaException; Index: topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java diff -u topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java:1.9 topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java:1.10 --- topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java:1.9 Fri Sep 17 15:55:55 2004 +++ topia/src/java/org/codelutin/topia/persistence/jdo/JDOPersistenceHelper.java Fri Dec 17 16:13:51 2004 @@ -23,9 +23,9 @@ * * @author Benjamin Poussin Copyright Code Lutin * - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ * - * Mise a jour: $Date: 2004/09/17 15:55:55 $ par : $Author: bpoussin $ + * Mise a jour: $Date: 2004/12/17 16:13:51 $ par : $Author: pineau $ */ package org.codelutin.topia.persistence.jdo; @@ -97,7 +97,7 @@ protected boolean isNewObject(TopiaEntity entity) throws TopiaException { String objectTopiaId = entity.get_topiaId_(); - String objectVersion = entity.get_version_(); + String objectVersion = entity.get_topiaVersion_(); return objectTopiaId == null || objectVersion == null || "".equals(objectVersion) || VersionNumberUtil.equals("0", objectVersion); @@ -137,9 +137,9 @@ done.add(entity.get_topiaId_()); //FIXME mettre a jour les info lastModificationDate, ... sur // entity - String version = entity.get_version_(); + String version = entity.get_topiaVersion_(); version = VersionNumberUtil.inc(version); - entity.set_version_(version); + entity.set_topiaVersion_(version); jdoEntity.update(entity, done, pm); }