Index: topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java diff -u topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java:1.10 topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java:1.11 --- topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java:1.10 Fri Jan 13 18:37:50 2006 +++ topia2/src/java/org/codelutin/topia/generator/EntityHibernateMappingGenerator.java Mon Jan 16 14:31:02 2006 @@ -24,9 +24,9 @@ * Created: 12 déc. 2005 * * @author Arnaud Thimel -* @version $Revision: 1.10 $ +* @version $Revision: 1.11 $ * -* Mise a jour: $Date: 2006/01/13 18:37:50 $ +* Mise a jour: $Date: 2006/01/16 14:31:02 $ * par : $Author: thimel $ */ @@ -199,21 +199,16 @@ } private void generateHibernateOneToOne(Writer output, ObjectModelAttribute attr) throws IOException { -/*{ <%=(attr.isComposite()?" cascade=\"delete\"":"")%>/> +/*{ <%=((attr.isComposite() || attr.hasAssociationClass())?" cascade=\"delete\"":"")%>/> }*/ } private void generateHibernateOneToMany(Writer output, ObjectModelAttribute attr) throws IOException { -// if (isAssoc && attr.getReverseAttribute() == null) { -// // FIXME URGENT genere un nom d'attribut en fonction de la classe -// // faire la meme chose sur l'entity (Interface, Abstract) -// } else { -/*{ lazy="true"<%=(attr.isComposite()?" cascade=\"delete,delete-orphan\"":"")%>> +/*{ lazy="true"<%=((attr.isComposite() || attr.hasAssociationClass())?" cascade=\"delete,delete-orphan\"":"")%>> }*/ -// } } private void generateHibernateMany(Writer output, ObjectModelAttribute attr) throws IOException { @@ -225,7 +220,7 @@ } private void generateHibernateManyToOne(Writer output, ObjectModelAttribute attr) throws IOException { -/*{ +/*{ /> }*/ } @@ -233,7 +228,7 @@ // On ne met le inverse="true" uniquement pour un seul coté de la relation. // Dans le cas contraire, les modifications dans la relation ne seront // pas sauvegardées -/*{ lazy="true"> +/*{ lazy="true"<%=((attr.isComposite() || attr.hasAssociationClass())?" cascade=\"delete,delete-orphan\"":"")%>>