Index: topia2/src/java/org/codelutin/topia/generator/DAOHelperGenerator.java diff -u topia2/src/java/org/codelutin/topia/generator/DAOHelperGenerator.java:1.6 topia2/src/java/org/codelutin/topia/generator/DAOHelperGenerator.java:1.7 --- topia2/src/java/org/codelutin/topia/generator/DAOHelperGenerator.java:1.6 Fri Mar 3 10:46:36 2006 +++ topia2/src/java/org/codelutin/topia/generator/DAOHelperGenerator.java Fri Mar 31 12:19:07 2006 @@ -25,9 +25,9 @@ * * @author Arnaud Thimel * - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * - * Mise a jour: $Date: 2006/03/03 10:46:36 $ par : $Author: thimel $ + * Mise a jour: $Date: 2006/03/31 12:19:07 $ par : $Author: thimel $ */ package org.codelutin.topia.generator; @@ -76,10 +76,10 @@ public static final String entitiesList = "" + }*/ - for (Iterator i=model.getClassifiers().iterator(); i.hasNext();) { - ObjectModelClassifier classifier = (ObjectModelClassifier)i.next(); - if(classifier.hasStereotype(GeneratorUtil.STEREOTYPE_ENTITY)){ -/*{ "<%=GeneratorUtil.getDOType(classifier, model)%><%=(i.hasNext()?",\" +":"\";")%> + for (Iterator i=model.getClasses().iterator(); i.hasNext();) { + ObjectModelClass clazz = (ObjectModelClass)i.next(); + if(!clazz.isAbstract() && clazz.hasStereotype(GeneratorUtil.STEREOTYPE_ENTITY)){ +/*{ "<%=GeneratorUtil.getDOType(clazz, model)%><%=(i.hasNext()?",\" +":"\";")%> }*/ } } @@ -93,7 +93,7 @@ }*/ } } -/*{ }; +/*{ }; /** *) Index: topia2/src/java/org/codelutin/topia/generator/GeneratorUtil.java diff -u topia2/src/java/org/codelutin/topia/generator/GeneratorUtil.java:1.9 topia2/src/java/org/codelutin/topia/generator/GeneratorUtil.java:1.10 --- topia2/src/java/org/codelutin/topia/generator/GeneratorUtil.java:1.9 Tue Feb 28 17:20:07 2006 +++ topia2/src/java/org/codelutin/topia/generator/GeneratorUtil.java Fri Mar 31 12:19:07 2006 @@ -25,9 +25,9 @@ * * @author Arnaud Thimel * - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ * - * Mise a jour: $Date: 2006/02/28 17:20:07 $ par : $Author: thimel $ + * Mise a jour: $Date: 2006/03/31 12:19:07 $ par : $Author: thimel $ */ package org.codelutin.topia.generator; @@ -281,8 +281,12 @@ } public static String getDOType(String type, ObjectModel model) { - if (model.hasClass(type) && model.getClassifier(type).hasStereotype(STEREOTYPE_ENTITY)) { - type += "Impl"; + if (model.hasClass(type) && model.getClass(type).hasStereotype(STEREOTYPE_ENTITY)) { + if (model.getClass(type).isAbstract()) { + type += "Abstract"; + } else { + type += "Impl"; + } } return type; } Index: topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java diff -u topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java:1.19 topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java:1.20 --- topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java:1.19 Wed Mar 8 19:13:26 2006 +++ topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java Fri Mar 31 12:19:07 2006 @@ -24,10 +24,10 @@ * Created: 12 déc. 2005 * * @author Arnaud Thimel -* @version $Revision: 1.19 $ +* @version $Revision: 1.20 $ * -* Mise a jour: $Date: 2006/03/08 19:13:26 $ -* par : $Author: bpoussin $ +* Mise a jour: $Date: 2006/03/31 12:19:07 $ +* par : $Author: thimel $ */ package org.codelutin.topia.generator; @@ -47,7 +47,9 @@ import org.codelutin.generator.models.object.ObjectModelAssociationClass; import org.codelutin.generator.models.object.ObjectModelAttribute; import org.codelutin.generator.models.object.ObjectModelClass; -import org.codelutin.generator.models.object.ObjectModelClassifier; + +import static org.codelutin.topia.generator.GeneratorUtil.STEREOTYPE_ENTITY; +import static org.codelutin.topia.generator.GeneratorUtil.PERSISTENCE_TYPE_HIBERNATE; /** * FIXME mettre les attributs node="..." sur tous les attributs @@ -74,13 +76,14 @@ @Override public String getFilenameForClass(ObjectModelClass clazz) { - return GeneratorUtil.getDOType(clazz, model).replace('.', File.separatorChar) + ".hbm.xml"; + String DOName = GeneratorUtil.getDOType(clazz, model); + return DOName.replace('.', File.separatorChar) + ".hbm.xml"; } @Override public void generateFromClass(Writer output, ObjectModelClass clazz) throws IOException { String persistenceType = GeneratorUtil.getPersistenceType(clazz); - if (!clazz.hasStereotype(GeneratorUtil.STEREOTYPE_ENTITY) && GeneratorUtil.PERSISTENCE_TYPE_HIBERNATE.equals(persistenceType)) { + if (!clazz.hasStereotype(STEREOTYPE_ENTITY) && PERSISTENCE_TYPE_HIBERNATE.equals(persistenceType)) { return; } /*{ @@ -93,10 +96,10 @@ ObjectModelClass superClass = (ObjectModelClass)clazz.getSuperclasses().iterator().next(); String superClassname = superClass.getQualifiedName(); if (log.isDebugEnabled()) {log.debug("superClass for " + clazz.getQualifiedName() + " is " + superClassname);} -/*{ +/*{ "> }*/ } else { -/*{ +/*{ "> @@ -111,7 +114,7 @@ continue; } if (!Util.isNMultiplicity(attr)) { - if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(GeneratorUtil.STEREOTYPE_ENTITY)) { + if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(STEREOTYPE_ENTITY)) { if (Util.isNMultiplicity(attr.getReverseMaxMultiplicity()) && !attr.hasAssociationClass()) { generateHibernateManyToOne(output, attr); } else { @@ -121,7 +124,7 @@ generateHibernateProperty(output, attr); } } else { - if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(GeneratorUtil.STEREOTYPE_ENTITY)) { + if (attr.getClassifier() != null && attr.getClassifier().hasStereotype(STEREOTYPE_ENTITY)) { if (Util.isNMultiplicity(attr.getReverseMaxMultiplicity()) && !attr.hasAssociationClass()) { generateHibernateManyToMany(output, attr); } else {