From: Vance K. <va...@us...> - 2007-06-13 16:31:38
|
User: vancek Date: 07/06/13 09:31:40 Modified: andromda-ejb3/src/site changes.xml andromda-ejb3/src/main/resources/templates/ejb3 EntityEmbeddable.vsl andromda-ejb3/src/main/uml EJB3MetafacadeModel.xml.zip andromda-ejb3/src/main/resources/META-INF/andromda profile.xml andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Globals.java EJB3Profile.java andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: ejb-50 - add hibernate uuid extension support Revision Changes Path 1.19 +5 -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.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- changes.xml 12 Jun 2007 16:23:25 -0000 1.18 +++ changes.xml 13 Jun 2007 16:31:34 -0000 1.19 @@ -469,6 +469,11 @@ is explicity modelled. It is fine to apply this naming pattern when this is not explicitly modelled and instance scoped operations exist on the entity and a mapped superclass is generated. </action> + <action dev="vancek" due-to="daveangulo" type="add"> + JIRA EJB-50 - Add UUID generic generator support as a Hibernate extension. This will render the + @GenericGenerator annotation. Modified the persistence profile (uml1.4 and 2.0) to support the necessary + tagged value. + </action> </release> </body> </document> \ No newline at end of file 1.51 +7 -0 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.50 retrieving revision 1.51 diff -u -w -r1.50 -r1.51 --- EntityEmbeddable.vsl 7 May 2007 13:32:32 -0000 1.50 +++ EntityEmbeddable.vsl 13 Jun 2007 16:31:35 -0000 1.51 @@ -416,9 +416,16 @@ @javax.persistence.TableGenerator(name = "${attribute.generatorName}"#if ($attribute.generatorTypeTable), table = "${attribute.generatorSourceName}"#end#if ($attribute.generatorPkColumnValue), pkColumnValue = "${attribute.generatorPkColumnValue}"#end#if ($attribute.generatorInitialValue), initialValue = ${attribute.generatorInitialValue}#end#if ($attribute.generatorAllocationSize), allocationSize = ${attribute.generatorAllocationSize}#end) #* *##end #* *##if (!$attribute.generatorTypeNone) +#* *##if ($attribute.generatorTypeGeneric) + @javax.persistence.GeneratedValue(generator = "${attribute.generatorName}") +#* *##else @javax.persistence.GeneratedValue(strategy = javax.persistence.GenerationType.${attribute.generatorType}#if ($attribute.generatorTypeSequence || $attribute.generatorTypeTable), generator = "${attribute.generatorName}"#end) #* *##end #* *##end +#* *##if ($attribute.generatorTypeGeneric && $hibernateExtensionEnabled) + @org.hibernate.annotations.GenericGenerator(name="${attribute.generatorName}", strategy = "${attribute.generatorGenericStrategy}") +#* *##end +#* *##end #* *##if ($attribute.lob) ## ## Add if LOB type is specified - do not set LOB type as of PFD Spec - inferred from type. 1.57 +238 -239 cartridges/andromda-ejb3/src/main/uml/EJB3MetafacadeModel.xml.zip <<Binary file>> 1.36 +14 -0 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/profile.xml Index: profile.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/profile.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -r1.35 -r1.36 --- profile.xml 29 Apr 2007 13:45:07 -0000 1.35 +++ profile.xml 13 Jun 2007 16:31:37 -0000 1.36 @@ -975,6 +975,7 @@ <value>SEQUENCE</value> <value>IDENTITY</value> <value>TABLE</value> + <value>GENERIC</value> <value>NONE</value> </allowedValues> </element> @@ -991,6 +992,19 @@ Entity Attribute </appliedOnElement> </element> + <element name="GENERATOR_GENERIC_STRATEGY"> + <documentation> + Defines either a predefined Hibernate strategy + or a fully qualified class name for use in + id generation using persistence layer extensions. + </documentation> + <value> + @andromda.persistence.generator.genericStrategy + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> <element name="GENERATOR_SOURCE_NAME"> <documentation> Specifies either the table name that stores the 1.16 +5 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Globals.java Index: EJB3Globals.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Globals.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -r1.15 -r1.16 --- EJB3Globals.java 25 Apr 2007 03:47:51 -0000 1.15 +++ EJB3Globals.java 13 Jun 2007 16:31:39 -0000 1.16 @@ -102,6 +102,11 @@ public static final String GENERATOR_TYPE_AUTO = "AUTO"; /** + * Represents the generic generator type + */ + public static final String GENERATOR_TYPE_GENERIC = "GENERIC"; + + /** * Represents the none generator type */ public static final String GENERATOR_TYPE_NONE = "NONE"; 1.29 +6 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Profile.java Index: EJB3Profile.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Profile.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -r1.28 -r1.29 --- EJB3Profile.java 29 Apr 2007 13:45:08 -0000 1.28 +++ EJB3Profile.java 13 Jun 2007 16:31:39 -0000 1.29 @@ -553,6 +553,12 @@ profile.get("GENERATOR_NAME"); /** + * The tagged value indicating the generator generic strategy. + */ + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_GENERIC_STRATEGY = + profile.get("GENERATOR_GENERIC_STRATEGY"); + + /** * The tagged value indicating the generator source name. */ public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_SOURCE_NAME = 1.19 +24 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- EJB3EntityAttributeFacadeLogicImpl.java 17 Jan 2007 00:50:55 -0000 1.18 +++ EJB3EntityAttributeFacadeLogicImpl.java 13 Jun 2007 16:31:39 -0000 1.19 @@ -250,6 +250,22 @@ } /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsGeneratorTypeGeneric() + */ + protected boolean handleIsGeneratorTypeGeneric() + { + boolean isGeneric = false; + if (StringUtils.isNotBlank(this.getGeneratorType())) + { + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_GENERIC)) + { + isGeneric = true; + } + } + return isGeneric; + } + + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleIsGeneratorTypeNone() */ protected boolean handleIsGeneratorTypeNone() @@ -290,6 +306,14 @@ } /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#getGeneratorGenericStrategy() + */ + protected String handleGetGeneratorGenericStrategy() + { + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_GENERATOR_GENERIC_STRATEGY); + } + + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogic#handleGetGeneratorSourceName() */ protected String handleGetGeneratorSourceName() |