|
From: Vance K. <va...@us...> - 2007-04-29 12:34:30
|
User: vancek
Date: 07/04/29 05:34:29
Modified: andromda-ejb3/src/site changes.xml
andromda-ejb3/src/main/resources/templates/ejb3
EntityEmbeddable.vsl
Log:
ejb-54 - fix entity class level annotations for multi-level single table inheritance hierarchy
Revision Changes Path
1.15 +6 -0 cartridges/andromda-ejb3/src/site/changes.xml
Index: changes.xml
===================================================================
RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/changes.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -r1.14 -r1.15
--- changes.xml 25 Apr 2007 03:47:49 -0000 1.14
+++ changes.xml 29 Apr 2007 12:34:28 -0000 1.15
@@ -446,6 +446,12 @@
when a topic is durable, removal of minPoolSize activation config and rename of maxPoolSize to maxSession
activation config. Reference http://galaxy.andromda.org/forum/viewtopic.php?p=21537#21537.
</action>
+ <action dev="vancek" due-to="khwalk" type="fix">
+ JIRA EJB-54 - Fix entity level annotations for multiple level single table inheritance hierarchy. When generating a one
+ level hierarchy, the @Table and @DiscriminatorColumn annotations exist on the top level entity. However,
+ when there is a multi-level single table inhiertance hierarchy, these 2 annotations exist on every parent
+ entity.
+ </action>
</release>
</body>
</document>
\ No newline at end of file
1.48 +8 -3 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityEmbeddable.vsl
Index: EntityEmbeddable.vsl
===================================================================
RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityEmbeddable.vsl,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -w -r1.47 -r1.48
--- EntityEmbeddable.vsl 16 Apr 2007 14:09:38 -0000 1.47
+++ EntityEmbeddable.vsl 29 Apr 2007 12:34:29 -0000 1.48
@@ -56,13 +56,15 @@
#**##end
##
## Include the Table annotation for a base class in single table inheritence hierarchy
-## but not in the subclasses. Include in all classes for joined and table per class
+## but not in the subclasses, regardless of multiple levels in the inhiertance hierarchy.
+##
+## Include in all classes for joined and table per class
## inheritance hierarchies.
##
## If a class is manually specified as an embeddable superclass, add
## the Table annotation to the subclass, not to the base superclass.
##
-#**##if (!$entity.entityImplementationRequired && ($entity.requiresSpecializationMapping || !$entity.requiresGeneralizationMapping || ($entity.requiresGeneralizationMapping && ($entity.embeddableSuperclassGeneralizationExists || $entity.inheritanceTablePerClass || $entity.inheritanceJoined))))
+#**##if (!$entity.entityImplementationRequired && (($entity.requiresSpecializationMapping && !$entity.requiresGeneralizationMapping) || !$entity.requiresGeneralizationMapping || ($entity.requiresGeneralizationMapping && ($entity.embeddableSuperclassGeneralizationExists || $entity.inheritanceTablePerClass || $entity.inheritanceJoined))))
@javax.persistence.Table(name = "${entity.tableName}")
#**##end
#**##if ($entity.listenerEnabled)
@@ -72,7 +74,10 @@
## Only include the inheritance related annotations for inheritance mapping
## that doesn't involve embeddable superclass hierarchy.
##
-#**##if ($entity.requiresSpecializationMapping)
+## Only include the inheritance and discriminator column mapping for the top level class
+## in the hierarchy, regardless of the number of levels in the hierarchy.
+##
+#**##if ($entity.requiresSpecializationMapping && !$entity.requiresGeneralizationMapping)
@javax.persistence.Inheritance(strategy = javax.persistence.InheritanceType.${entity.inheritanceStrategy})
##
## Discriminator components only apply to single table mapping strategy
|