Index: topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java diff -u topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java:1.22 topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java:1.23 --- topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java:1.22 Fri Jun 18 18:29:19 2004 +++ topia/src/java/org/codelutin/topia/generators/jdo/ObjectModelToEntityDOClassGenerator.java Fri Jun 18 18:58:24 2004 @@ -99,16 +99,16 @@ if (!Util.isDerived(attribute)) { if(!attribute.referenceClassifier()){ /*{ - protected <%=Util.getAttributeTypeForDO(attribute)%> _<%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; + protected <%=Util.getAttributeTypeForDO(attribute)%> <%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; }*/ }else{ if(Util.isNMultiplicity(attribute)){ /*{ - protected <%=Util.getAttributeTypeForDO(attribute)%> _<%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; + protected <%=Util.getAttributeTypeForDO(attribute)%> <%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; }*/ }else{ /*{ - protected <%=attribute.getClassifier().getName()%>JDODO _<%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; + protected <%=attribute.getClassifier().getName()%>JDODO <%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; }*/ } } @@ -126,7 +126,7 @@ if (!Util.isDerived(attribute)) { /*{ public <%=Util.getAttributeType(attribute)%> get<%=Util.capitalize(attribute.getName())%>() throws TopiaException { - return _<%=attribute.getName()%>; + return <%=attribute.getName()%>; } }*/ } @@ -142,7 +142,7 @@ if(!attribute.referenceClassifier()){ /*{ public void set<%=Util.capitalize(attribute.getName())%>(<%=Util.getAttributeType(attribute)%> value) throws TopiaException { - this._<%=attribute.getName()%> = value; + this.<%=attribute.getName()%> = value; } }*/ }else{ @@ -152,7 +152,7 @@ if(!(value instanceof TopiaEntityDO)){ throw new TopiaException("Only DO can be used for entity attribute"); } - this._<%=attribute.getName()%> = (<%=classifier.getName()%>JDODO)value; + this.<%=attribute.getName()%> = (<%=classifier.getName()%>JDODO)value; } }*/ @@ -165,7 +165,7 @@ throw new TopiaException("Only DO can be used for entity attribute"); } <% } %> - this._<%=attribute.getName()%>.add(value); + this.<%=attribute.getName()%>.add(value); } public void remove<%=Util.capitalize(attribute.getName())%>(<%=attribute.getType()%> value) throws TopiaException { @@ -174,11 +174,11 @@ throw new TopiaException("Only DO can be used for entity attribute"); } <% } %> - this._<%=attribute.getName()%>.remove(value); + this.<%=attribute.getName()%>.remove(value); } public void clear<%=Util.capitalize(attribute.getName())%>() throws TopiaException { - this._<%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; + this.<%=attribute.getName()%> = <%=Util.getInitValue(attribute)%>; } }*/ } @@ -201,9 +201,17 @@ public void generateTopiaIdOperation(Writer output, ObjectModelClassifier clazz) throws IOException { /*{ + protected String _topiaId_ = ""; + + /** + * TODO in futur, not used JDO id, but generate unique ID + *) public Object get_topiaId_() throws TopiaException { - PersistenceManager persistenceManager = ((TopiaJDOPersistenceHelper) getContext().getPersistenceHelper()).getPersistenceManager(); - return persistenceManager.getObjectId(this); + if("".equals(_topiaId_)){ + PersistenceManager persistenceManager = ((TopiaJDOPersistenceHelper) getContext().getPersistenceHelper()).getPersistenceManager(); + this._topiaId_ = persistenceManager.getObjectId(this).toString(); + } + return this._topiaId_; } }*/ } @@ -230,7 +238,7 @@ if(! Util.isDerived(attribute)){ if (! attribute.referenceClassifier()) { /*{ - this._<%=attribute.getName()%> = entity.get<%=Util.capitalize(attribute.getName())%>(); + this.<%=attribute.getName()%> = entity.get<%=Util.capitalize(attribute.getName())%>(); }*/ } else { if (!Util.isNMultiplicity(attribute)) { @@ -238,9 +246,9 @@ if(entity.is_<%=attribute.getName()%>Modified_()){ TopiaEntityTO te = (TopiaEntityTO)entity.get<%=Util.capitalize(attribute.getName())%>(); if (te != null){ - this._<%=attribute.getName()%> = (<%=attribute.getClassifier().getName()%>JDODO)te.toDO(done); + this.<%=attribute.getName()%> = (<%=attribute.getClassifier().getName()%>JDODO)te.toDO(done); }else{ - this._<%=attribute.getName()%> = null; + this.<%=attribute.getName()%> = null; } } }*/ @@ -257,7 +265,7 @@ tmpIds.add(null); } } - this._<%=attribute.getName()%> = tmpIds; + this.<%=attribute.getName()%> = tmpIds; } } }*/