From: Vance K. <va...@us...> - 2006-06-26 06:37:14
|
User: vancek Date: 06/06/25 23:37:13 Modified: andromda-ejb3/src/main/resources/templates/ejb3 EntityEmbeddable.vsl Log: moved @Version annotation from getter to attribute - all other annotation of the getter of a version attribute are disabled render the @Table annotation for every suitable entity - not just those with inheritence Revision Changes Path 1.33 +14 -5 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.32 retrieving revision 1.33 diff -u -w -r1.32 -r1.33 --- EntityEmbeddable.vsl 17 Jun 2006 03:51:02 -0000 1.32 +++ EntityEmbeddable.vsl 26 Jun 2006 06:37:12 -0000 1.33 @@ -55,7 +55,7 @@ ## 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.embeddableSuperclassGeneralizationExists || $entity.inheritanceTablePerClass || $entity.inheritanceJoined)))) +#**##if (!$entity.entityImplementationRequired && ($entity.requiresSpecializationMapping || !$entity.requiresGeneralizationMapping || ($entity.requiresGeneralizationMapping && ($entity.embeddableSuperclassGeneralizationExists || $entity.inheritanceTablePerClass || $entity.inheritanceJoined)))) @javax.persistence.Table(name = "${entity.tableName}") #**##end #**##if ($entity.listenerEnabled) @@ -169,6 +169,12 @@ #* *##set ($doAttribute = true) #* *##end #* *##if ($doAttribute) +#* *##if (!$attribute.transient && $attribute.version) +## +## Add the Version annotation on the attribute itself +## + @javax.persistence.Version +#* *##end ## ## Check for overriding LOB type ## @@ -382,7 +388,7 @@ ## #* *##if ($attribute.transient) @javax.persistence.Transient -#* *##else +#* *##elseif (!$attribute.version) #* *##if ($attribute.identifier) @javax.persistence.Id #* *##if ($attribute.sequenceGeneratorType) @@ -394,9 +400,6 @@ @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.${attribute.generatorType}#if ($attribute.sequenceGeneratorType || $attribute.tableGeneratorType), generator = "${attribute.generatorName}"#end) #* *##end #* *##end -#* *##if ($attribute.version) - @javax.persistence.Version -#* *##end #* *##if ($attribute.lob) ## ## Add if LOB type is specified - do not set LOB type as of PFD Spec - inferred from type. @@ -559,6 +562,9 @@ #* *##if ($target.associationCacheEnabled) @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.${target.cacheType}) #* *##end +#* *##if ($target.defaultCollectionInterfaceSortedSet) + @org.hibernate.annotations.Sort(type = org.hibernate.annotations.SortType.NATURAL) +#* *##end #* *##end public $target.getterSetterTypeName ${target.getterName}() { @@ -674,6 +680,9 @@ #* *##if ($target.associationCacheEnabled) @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.${target.cacheType}) #* *##end +#* *##if ($target.defaultCollectionInterfaceSortedSet) + @org.hibernate.annotations.Sort(type = org.hibernate.annotations.SortType.NATURAL) +#* *##end #* *##end public $target.getterSetterTypeName ${target.getterName}() { |