Index: topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceGenerator.java diff -u topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceGenerator.java:1.2 topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceGenerator.java:1.3 --- topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceGenerator.java:1.2 Fri Aug 6 17:48:52 2004 +++ topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceGenerator.java Thu Sep 2 15:45:37 2004 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * - * Mise a jour: $Date: 2004/08/06 17:48:52 $ - * par : $Author: bpoussin $ + * Mise a jour: $Date: 2004/09/02 15:45:37 $ + * par : $Author: mazelier $ */ package org.codelutin.topia.generators; @@ -129,6 +129,8 @@ public <%=clazz.getName()%> create<%=clazz.getName()%>() throws TopiaException; public <%=clazz.getName()%> makePersistent(<%=clazz.getName()%> entity) throws TopiaException; + + public String [] getFieldNames(); }*/ } } Index: topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceImplGenerator.java diff -u topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceImplGenerator.java:1.1 topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceImplGenerator.java:1.2 --- topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceImplGenerator.java:1.1 Fri Aug 6 17:51:30 2004 +++ topia/src/java/org/codelutin/topia/generators/ObjectModelToEntityPersistenceServiceImplGenerator.java Thu Sep 2 15:45:37 2004 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * - * Mise a jour: $Date: 2004/08/06 17:51:30 $ - * par : $Author: bpoussin $ + * Mise a jour: $Date: 2004/09/02 15:45:37 $ + * par : $Author: mazelier $ */ package org.codelutin.topia.generators; @@ -125,14 +125,15 @@ // O T H E R ////////////////////////////////////////////////////////////////////// - public void generateOther(Writer output, ObjectModelClassifier clazz) throws IOException { + public void generateOther(Writer output, ObjectModelClassifier clazzifier) throws IOException { + ObjectModelClass clazz = (ObjectModelClass)clazzifier; /*{ /** * Return new entity *) public <%=clazz.getName()%> create<%=clazz.getName()%>() throws TopiaException { - <% if(((ObjectModelClass)clazz).isAbstract()){ %> + <% if(clazz.isAbstract()){ %> throw new TopiaException("Abstract entity can't be instanciate"); <% } else { %> return (<%=clazz.getName()%>)super.create(); @@ -156,6 +157,19 @@ public <%=model.getName()%>Context getAppContext(){ <%=model.getName()%>Context context = (<%=model.getName()%>Context)getContext(); return context; + } + + protected String [] fielNames = new String[]{ + <% for(Iterator i=clazz.getAttributes().iterator(); i.hasNext();){ %> + "<%=((ObjectModelAttribute)i.next()).getName()%>", + <% } %> + <% for(Iterator i=clazz.getAllOtherAttributes().iterator(); i.hasNext();){ %> + "<%=((ObjectModelAttribute)i.next()).getName()%>", + <% } %> + }; + + public String [] getFieldNames(){ + return fielNames; } }*/