Index: topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToJDOEntityGenerator.java diff -u topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToJDOEntityGenerator.java:1.9 topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToJDOEntityGenerator.java:1.10 --- topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToJDOEntityGenerator.java:1.9 Fri Dec 17 16:13:51 2004 +++ topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToJDOEntityGenerator.java Wed Apr 27 13:49:01 2005 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ * - * Mise a jour: $Date: 2004/12/17 16:13:51 $ - * par : $Author: pineau $ + * Mise a jour: $Date: 2005/04/27 13:49:01 $ + * par : $Author: bpoussin $ */ package org.codelutin.topia.generators.jdo; @@ -152,12 +152,12 @@ ////////////////////////////////////////////////////////////////////// // all next method are in abstract class before - if(!(clazzifier instanceof ObjectModelClass)){ - /*{ - public TopiaEntity getLazy(TopiaContext context) throws TopiaException; - }*/ - return; - } + if(!(clazzifier instanceof ObjectModelClass)){ + /*{ + public TopiaEntity getLazy(TopiaContext context) throws TopiaException; + }*/ + return; + } if(!hasParent){ /*{ @@ -263,7 +263,7 @@ hasParent = parents.hasNext(); if (hasParent) { /*{ - super.update(topiaEntity, done, pm); + super.update(topiaEntity, done, pm); }*/ } /*{ @@ -285,12 +285,19 @@ if(entity.is_<%=attribute.getName()%>Modified_()){ }*/ if (! attribute.referenceClassifier()) { -/*{ + if("java.util.Date".equals(attribute.getType())){/*{ + if(entity.get<%=Util.capitalize(attribute.getName())%> == null){ + this.<%=attribute.getName()%> = null; + } else { + this.<%=attribute.getName()%> = (java.util.Date)entity.get<%=Util.capitalize(attribute.getName())%>().clone(); + } +}*/ + } else {/*{ this.<%=attribute.getName()%> = entity.get<%=Util.capitalize(attribute.getName())%>(); }*/ + } } else { - if (!Util.isNMultiplicity(attribute)) { -/*{ + if (!Util.isNMultiplicity(attribute)) {/*{ TopiaEntity te = (TopiaEntity)entity.get<%=Util.capitalize(attribute.getName())%>(); if (te != null){ JDOEntity tejdo = getPersistenceHelper().update(te, done, pm); @@ -299,8 +306,7 @@ this.<%=attribute.getName()%> = null; } }*/ - } else { -/*{ + } else {/*{ ArrayList tmpIds = new ArrayList(); for (Iterator i=entity.get<%=Util.capitalize(attribute.getName())%>().iterator(); i.hasNext();) { TopiaEntity te = (TopiaEntity)i.next(); @@ -314,8 +320,7 @@ this.<%=attribute.getName()%> = tmpIds; }*/ } - } -/*{ + }/*{ } }*/ } @@ -341,7 +346,7 @@ hasParent = parents.hasNext(); if (hasParent) { /*{ - super.convertToEntity(result); + super.convertToEntity(result); }*/ } /*{