From: Vance K. <va...@us...> - 2006-06-14 04:55:22
|
User: vancek Date: 06/06/13 21:55:21 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionBeanBase.vsl Entity.vsl EntityEmbeddable.vsl andromda-ejb3/src/main/resources/META-INF/andromda namespace.xml profile.xml andromda-ejb3/src/main/resources/templates/ejb3/config ejb-jar.xml.vsl andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityFacadeLogicImpl.java Log: added initial JBoss Seam support Revision Changes Path 1.6 +44 -10 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBeanBase.vsl Index: SessionBeanBase.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBeanBase.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- SessionBeanBase.vsl 3 Jun 2006 15:39:42 -0000 1.5 +++ SessionBeanBase.vsl 14 Jun 2006 04:55:20 -0000 1.6 @@ -1,5 +1,8 @@ // license-header java merge-point -/* Autogenerated by AndroMDA (SessionBean.vsl) - do not edit */ +// +// Attention: Generated code! Do not modify by hand! +// Generated by: SessionBeanBase.vsl in andromda-ejb3-cartridge. +// #parse("templates/ejb3/Globals.vm") #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; @@ -16,6 +19,15 @@ * $service.getDocumentation(" * ") */ +## +## Define the Seam component name for the class if JBoss Seam is enabled +## +#**##if ($service.seamComponent) +...@or...("${service.seamComponentName}") +#* *##if ($stringUtils.isNotBlank($service.seamComponentScopeType)) +...@or...ope(org.jboss.seam.ScopeType.${service.seamComponentScopeType}) +#* *##end +#**##end #if ($service.transactionManagement) @javax.ejb.TransactionManagement(javax.ejb.TransactionManagementType.${service.transactionManagement}) #end @@ -180,6 +192,19 @@ /** * The $attribute.name property */ +#* *##if ($service.seamComponent) +#* *##if ($attribute.seamComponentIn) + @org.jboss.seam.annotations.In#if (!$attribute.required)(required = false)#else#**#(create = true)#end + +#* *##end +#* *##if ($attribute.seamComponentOut) + @org.jboss.seam.annotations.Out#if (!$attribute.required)(required = false)#end + +#* *##end +#* *##if ($attribute.seamValidationValid) + @org.hibernate.validator.Valid +#* *##end +#* *##end protected $attribute.type.fullyQualifiedName $attribute.name; #**##end @@ -252,7 +277,6 @@ #**##foreach ($attribute in $instanceAttributes) #* *##set ($visibility = $attribute.visibility) -#* *##if ($visibility == "public") /** * Get the ${attribute.name} property $attribute.getDocumentation(" * ") @@ -285,7 +309,6 @@ #* *##end #* *##end -#**##end #end #if (!$entityReferences.empty) @@ -350,6 +373,17 @@ // Interceptor class exclusions are defined in ejb-jar.xm // @javax.interceptor.ExcludeClassInterceptors #* *##end +#* *##if ($service.seamComponent) +#* *##if ($operation.seamLifecycleCreate) + @org.jboss.seam.annotations.Create +#* *##elseif ($operation.seamLifecycleDestroy) + @org.jboss.seam.annotations.Destroy +#* *##end +#* *##if ($operation.seamValidationValidator) +#* *##set ($argExists = false) + @org.jboss.seam.annotations.IfInvalid(#if ($operation.seamValidationOutcome)outcome = ${operation.seamValidationOutcome}#set ($argExists = true)#end#if ($operation.seamValidationRefreshEntities)#if ($argExists), #end#**#refreshEntities = ${operation.seamValidationRefreshEntities}#end) +#* *##end +#* *##end $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #* *##if ($operation.exceptionsPresent) $operation.throwsClause 1.19 +15 -8 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- Entity.vsl 15 May 2006 12:44:38 -0000 1.18 +++ Entity.vsl 14 Jun 2006 04:55:20 -0000 1.19 @@ -20,22 +20,29 @@ */ @javax.persistence.Entity +#if ($entity.seamComponent) +...@or...("${entity.seamComponentName}") +#**##if ($stringUtils.isNotBlank($entity.seamComponentScopeType)) +...@or...ope(org.jboss.seam.ScopeType.${entity.seamComponentScopeType}) +#**##end +#else +// Uncomment to enable seam component name +// @org.jboss.seam.annotations.Name("${entity.seamComponentName}") +// Uncomment to set specific component scope type +//@org.jboss.seam.annotations.Scope(org.jboss.seam.ScopeType.#if ($entity.stateless)STATELESS#else#**#CONVERSATION#end) +#end @javax.persistence.Table(name = "${entity.tableName}") #if ($entity.listenerEnabled) @javax.persistence.EntityListeners({${entity.fullyQualifiedEntityListenerName}.class}) #else -/** - * Uncomment to enable entity listener for ${entity.entityName} - * @javax.persistence.EntityListeners({${entity.fullyQualifiedEntityListenerName}.class}) - */ +// Uncomment to enable entity listener for ${entity.entityName} +// @javax.persistence.EntityListeners({${entity.fullyQualifiedEntityListenerName}.class}) #end #if ($entity.cacheEnabled) @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.${entity.cacheType}) #else -/** - * Uncomment to enable caching for ${entity.entityName} - * @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.${entity.cacheType}) - */ +// Uncomment to enable caching for ${entity.entityName} +// @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.${entity.cacheType}) #end #set ($finders = $entity.getQueryOperations(false)) #if (!$finders.empty) 1.31 +17 -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.30 retrieving revision 1.31 diff -u -w -r1.30 -r1.31 --- EntityEmbeddable.vsl 1 Jun 2006 14:40:47 -0000 1.30 +++ EntityEmbeddable.vsl 14 Jun 2006 04:55:20 -0000 1.31 @@ -41,6 +41,12 @@ @javax.persistence.MappedSuperclass #else @javax.persistence.Entity +#**##if ($entity.seamComponent) +...@or...("${entity.seamComponentName}") +#* *##if ($stringUtils.isNotBlank($entity.seamComponentScopeType)) +...@or...ope(org.jboss.seam.ScopeType.${entity.seamComponentScopeType}) +#* *##end +#**##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 @@ -426,6 +432,17 @@ #* *##if ($stringUtils.isNotBlank($attribute.enumerationType)) @javax.persistence.Enumerated(javax.persistence.EnumType.${attribute.enumerationType}) #* *##end +#* *##if ($entity.seamComponent) +## +## If JBoss Seam is enabled, add NotNull and Length annotations +## +#* *##if (!$attribute.columnNullable) + @org.hibernate.validator.NotNull +#* *##end +#* *##if ($attribute.columnLength) + @org.hibernate.validator.Length(max = $attribute.columnLength) +#* *##end +#* *##end #* *##end ## ## Override attribute type if attribute is a LOB and lob type is specified 1.23 +7 -0 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -r1.22 -r1.23 --- namespace.xml 30 Apr 2006 01:52:09 -0000 1.22 +++ namespace.xml 14 Jun 2006 04:55:21 -0000 1.23 @@ -1064,6 +1064,13 @@ locator class. </documentation> </property> + <property name="seamEnabled"> + <default>false</default> + <documentation> + Set to true to enable the JBoss Seam application + framework for Java EE 5. + </documentation> + </property> </propertyGroup> </properties> </namespace> \ No newline at end of file 1.30 +107 -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.29 retrieving revision 1.30 diff -u -w -r1.29 -r1.30 --- profile.xml 3 Jun 2006 15:36:47 -0000 1.29 +++ profile.xml 14 Jun 2006 04:55:21 -0000 1.30 @@ -430,6 +430,71 @@ <value>WebServiceOperation</value> <appliedOnElement>Service operation</appliedOnElement> </element> + <element name="SEAM_COMPONENT"> + <documentation> + Indicates this bean is a Seam component object. This + must be set before anything else is modelled on the class. + </documentation> + <value>Seam</value> + <appliedOnElement>Entity, Session and Java Beans</appliedOnElement> + </element> + <element name="SEAM_COMPONENT_IN"> + <documentation> + Indicates a Seam component attribute which is to be injected + from a context variable at the begining of each component method + invocation. + </documentation> + <value>In</value> + <appliedOnElement>Session and Java Bean Attribute</appliedOnElement> + </element> + <element name="SEAM_COMPONENT_OUT"> + <documentation> + Indicates a Seam component attribute which is to be outjected + to a context variable at the end of each component method + invocation. + </documentation> + <value>Out</value> + <appliedOnElement>Session and Java Bean Attribute</appliedOnElement> + </element> + <element name="SEAM_LIFECYCLE_CREATE"> + <documentation> + Indicates that the method is a Seam component lifecycle operation + and should be called when an instance of the component is instantiated by + Seam. + </documentation> + <value>Create</value> + <appliedOnElement>Session and Java Bean Operation</appliedOnElement> + </element> + <element name="SEAM_LIFECYCLE_DESTROY"> + <documentation> + Indicates that the method is a Seam component lifecycle operation + and should be called when the context ends and its context variables + are destroyed. + All SFSB components must define a Destroy method to guarantee + destruction of the SFSB when the context ends. + </documentation> + <value>Destroy</value> + <appliedOnElement>Session and Java Bean Operation</appliedOnElement> + </element> + <element name="SEAM_VALIDATION_VALID"> + <documentation> + Specifies that the Hibernate Validator should validate this and related + component attributes before an action listener Seam component method is + invoked. + </documentation> + <value>Valid</value> + <appliedOnElement>Session and Java Bean Attribute</appliedOnElement> + </element> + <element name="SEAM_VALIDATION_VALIDATOR"> + <documentation> + Specifies that the validator should validate all Seam components marked + with @Valid annotation before the method is invoked. Use of + tagged values for outcome when validation fails and for refreshing + entities when validation fails is provided. + </documentation> + <value>Validator</value> + <appliedOnElement>Session and Java Bean Operations</appliedOnElement> + </element> </elementGroup> <elementGroup name="Tagged Values"> <element name="ATTRIBUTE_PERSISTENCE_OPTIONAL"> @@ -1357,6 +1422,48 @@ <value>@andromda.webservice.operation.result.name</value> <appliedOnElement>Service and WebService</appliedOnElement> </element> + <element name="SEAM_COMPONENT_SCOPE_TYPE"> + <documentation> + The JBoss Seam component scope type. + The default for stateless session beans is STATELESS. + The default for entity beans and stateful session beans + is CONVERSATION. + </documentation> + <value>@andromda.seam.component.scope</value> + <appliedOnElement>Entity, Session and Java Beans</appliedOnElement> + <allowedValues> + <value>EVENT</value> + <value>PAGE</value> + <value>CONVERSATION</value> + <value>SESSION</value> + <value>BUSINESS_PROCESS</value> + <value>APPLICATION</value> + <value>STATELESS</value> + </allowedValues> + </element> + <element name="SEAM_COMPONENT_NAME"> + <documentation> + Override the default Seam component object name. + </documentation> + <value>@andromda.seam.component.name</value> + <appliedOnElement>Entity, Session and Java Beans</appliedOnElement> + </element> + <element name="SEAM_VALIDATION_OUTCOME"> + <documentation> + Returns the JSF outcome when validation fails. + </documentation> + <value>@andromda.seam.validation.outcome</value> + <appliedOnElement>Session and Java Bean Operation</appliedOnElement> + </element> + <element name="SEAM_VALIDATION_REFRESH_ENTITIES"> + <documentation> + Specifies whether invalid entities in the managed state + should be refreshed from the database when + validation fails. + </documentation> + <value>@andromda.seam.validation.refreshEntities</value> + <appliedOnElement>Session and Java Bean Operation</appliedOnElement> + </element> </elementGroup> </elements> </profile> \ No newline at end of file 1.6 +6 -0 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/ejb-jar.xml.vsl Index: ejb-jar.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/ejb-jar.xml.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- ejb-jar.xml.vsl 3 Jun 2006 15:36:47 -0000 1.5 +++ ejb-jar.xml.vsl 14 Jun 2006 04:55:21 -0000 1.6 @@ -221,6 +221,12 @@ </interceptor-binding> #**##end #end +#if (${seamEnabled} == 'true') + <interceptor-binding> + <ejb-name>*</ejb-name> + <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class> + </interceptor-binding> +#end </assembly-descriptor> </ejb-jar> \ No newline at end of file 1.24 +24 -2 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java Index: EJB3EntityFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -r1.23 -r1.24 --- EJB3EntityFacadeLogicImpl.java 15 May 2006 12:30:17 -0000 1.23 +++ EJB3EntityFacadeLogicImpl.java 14 Jun 2006 04:55:21 -0000 1.24 @@ -1592,5 +1592,27 @@ String.valueOf(this.getConfiguredProperty(EJB3Globals.HIBERNATE_USER_QUERY_CACHE))); } + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacadeLogic#handleIsSeamComponent() + */ + protected boolean handleIsSeamComponent() + { + return EJB3MetafacadeUtils.isSeamComponent(this); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacadeLogic#handleGetSeamComponentScopeType() + */ + protected String handleGetSeamComponentScopeType() + { + return EJB3MetafacadeUtils.getSeamComponentScopeType(this, false); + } + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacadeLogic#handleGetSeamComponentName() + */ + protected String handleGetSeamComponentName() + { + return EJB3MetafacadeUtils.getSeamComponentName(this); + } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2007-07-21 13:31:51
|
User: vancek Date: 07/07/21 06:31:53 Modified: andromda-ejb3/src/site changes.xml andromda-ejb3/src/test/expected cartridge-output.zip andromda-ejb3/src/test/uml EJB3CartridgeTestModel.xml.zip andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityFacadeLogicImpl.java Log: ejb-65 - fix for abstract parent entities and supporting associations Revision Changes Path 1.25 +10 -1 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.24 retrieving revision 1.25 diff -u -w -r1.24 -r1.25 --- changes.xml 30 Jun 2007 03:53:47 -0000 1.24 +++ changes.xml 21 Jul 2007 13:31:51 -0000 1.25 @@ -505,6 +505,15 @@ relationNameSeparator in the andromda.xml within the ejb3 namespace with a value of underscore (_) if you wish to adopt this separator. The default separator will remain the AndroMDA default digit two. </action> + <action dev="walter" type="add"> + JIRA EJB-58 - Add readById method to crud services such that cartridge can be used with JSF2 cartridge + and crud/manageable features. + </action> + <action dev="vancek" due-to="hermida" type="fix"> + JIRA EJB-65 - Modify the cartridge to support abstract parent entities. EJB2.x did not support this, but + this is now supported with EJb 3.0. An abstract parent entity can have a relationship with any other + entity and this should be available to the child inheriting entities. Add test cases to support this. + </action> </release> </body> </document> \ No newline at end of file 1.15 +515 -499 cartridges/andromda-ejb3/src/test/expected/cartridge-output.zip <<Binary file>> 1.10 +298 -248 cartridges/andromda-ejb3/src/test/uml/EJB3CartridgeTestModel.xml.zip <<Binary file>> 1.30 +1 -29 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java Index: EJB3EntityFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -r1.29 -r1.30 --- EJB3EntityFacadeLogicImpl.java 17 Feb 2007 14:09:07 -0000 1.29 +++ EJB3EntityFacadeLogicImpl.java 21 Jul 2007 13:31:53 -0000 1.30 @@ -289,24 +289,7 @@ */ protected java.util.Collection handleGetAllEntityRelations() { - // Only concrete entities may have EJB relations. Return - // an empty collection for everything else - if (this.isAbstract()) - { - return Collections.EMPTY_LIST; - } - - Collection result = new ArrayList(); - result.addAll(getEntityRelations()); - - ClassifierFacade classifier = (ClassifierFacade)this.getGeneralization(); - while (classifier != null && classifier instanceof EJB3EntityFacade && classifier.isAbstract()) - { - EJB3EntityFacade entity = (EJB3EntityFacade)classifier; - result.addAll(entity.getEntityRelations()); - classifier = (ClassifierFacade)classifier.getGeneralization(); - } - return result; + return this.getEntityRelations(); } /** @@ -413,17 +396,6 @@ ClassifierFacade target = associationEnd.getOtherEnd().getType(); if (target instanceof EJB3EntityFacade && associationEnd.getOtherEnd().isNavigable()) { - // Check the integrity constraint - Object value = associationEnd.getOtherEnd().getAssociation().findTaggedValue( - EJB3Profile.TAGGEDVALUE_GENERATE_CMR); - String generateCmr = value == null ? null : value.toString(); - if (target.isAbstract() && !"false".equalsIgnoreCase(generateCmr)) - { - throw new IllegalStateException("Relation '" + associationEnd.getAssociation().getName() + - "' has the abstract target '" + - target.getName() + - "'. Abstract targets are not allowed in EJB."); - } result.add(associationEnd); } } |
From: Vance K. <va...@us...> - 2007-11-30 12:14:28
|
User: vancek Date: 07/11/30 04:14:32 Modified: andromda-ejb3/src/site changes.xml andromda-ejb3/src/test/uml EJB3CartridgeTestModel.xml.zip andromda-ejb3/src/site/resources/howto HowToModel.xml.zip HowToPictures.zip andromda-ejb3/src/main/resources/META-INF/andromda metafacades.xml andromda-ejb3/src/site/axdoc howto9.xml andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityFacadeLogicImpl.java Log: jira ejb-53 - reverse part of the original patch to force adding the Entity stereotype on mapped superclasses to fix issue with uml2.0. Revision Changes Path 1.30 +8 -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.29 retrieving revision 1.30 diff -u -w -r1.29 -r1.30 --- changes.xml 7 Nov 2007 14:57:23 -0000 1.29 +++ changes.xml 30 Nov 2007 12:14:31 -0000 1.30 @@ -537,6 +537,14 @@ then instead of using the @EJB annotation, use the Seam @In annotation. This applies when the source session bean is also a Seam component. </action> + <action dev="vancek" type="fix"> + JIRA EJB-53 - After applying the patch to add EJB3MappedSuperclassFacade metafacades which extend + EJB3EntityFacade and avoid the need to also model the Entity stereotype (as well as the MappedSuperclass), + several bugs appeared where dynamic identifiers were created regardless of the condition and explicitly + modelled identifiers were ignored. This only affected UML2 models. This patch reverses a part of that + patched; such that we still require to model the Entity stereotype as well as the MappedSuperclass + stereotype on all mapped superclasses. + </action> </release> </body> </document> \ No newline at end of file 1.13 +291 -266 cartridges/andromda-ejb3/src/test/uml/EJB3CartridgeTestModel.xml.zip <<Binary file>> 1.3 +197 -229 cartridges/andromda-ejb3/src/site/resources/howto/HowToModel.xml.zip <<Binary file>> 1.3 +327 -196 cartridges/andromda-ejb3/src/site/resources/howto/HowToPictures.zip <<Binary file>> 1.36 +1 -0 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/metafacades.xml Index: metafacades.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/metafacades.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -r1.35 -r1.36 --- metafacades.xml 27 Aug 2007 14:19:10 -0000 1.35 +++ metafacades.xml 30 Nov 2007 12:14:32 -0000 1.36 @@ -85,6 +85,7 @@ <!-- Mapped Superclass Metafacades --> <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3MappedSuperclassFacadeLogicImpl" contextRoot="true"> <mapping> + <stereotype>ENTITY</stereotype> <stereotype>MAPPED_SUPERCLASS</stereotype> </mapping> </metafacade> 1.6 +6 -30 cartridges/andromda-ejb3/src/site/axdoc/howto9.xml Index: howto9.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/axdoc/howto9.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- howto9.xml 7 May 2007 13:32:32 -0000 1.5 +++ howto9.xml 30 Nov 2007 12:14:32 -0000 1.6 @@ -50,38 +50,14 @@ <a name="Mapped_Superclasses"/> <subsection name="Mapped Superclasses"> <p> - To explicity define an entity as a mapped superclass, model the - <![CDATA[<<MappedSuperclass>>]]> stereotype on the root entity. In the past, you had to - model the <![CDATA[<<Entity>>]]> stereotype as well on this class, but this is no longer - necessary if you are using the latest cartridge source. + To explicity define an entity as a mapped superclass, model the <![CDATA[<<Entity>>]]> <b>AND</b> + <![CDATA[<<MappedSuperclass>>]]> stereotypes on the class. (Note: The cartridge did attempt to + avoid the need to model the <![CDATA[<<Entity>>]]> stereotype, however this caused issue with UML2 + models) </p> <p class="highlight"> - If you do not want to model the <![CDATA[<<Entity>>]]> stereotype as well - in theory, a mapped - superclass is NOT an entity and it doesn't make sense for this stereotype to exist - you must - also disable the following two constraints in your <code>andromda.xml</code> by adding the following - <b>constraints</b> section. Rest assured that by disabling these constraints, your are not - vulnerable to modelling flaws, since the constraints that exist on the <i>EJB3EntityFacade</i> will - enforce these constraints. -<source language="xml"><![CDATA[ - <repository name="netBeansMDR"> - <models> - <model> - <uri>${model.uri}</uri> - <moduleSearchLocations> - <location patterns="**/*.xml.zip">${settings.localRepository}/org/andromda/profiles/</location> - </moduleSearchLocations> - <constraints enforceAll="true"> - <constraint enforce="false">org::andromda::metafacades::uml::Entity::entities can only generalize other entities</constraint> - <constraint enforce="false">org::andromda::metafacades::uml::Entity::entity must have at least one primary key</constraint> - </constraints> - </model> - </models> - </repository> -]]></source> - </p> - <p class="highlight"> - In this case, you must explicity define your identifiers either in the mapped superclass or in - the inheriting subclass entity. + You must explicity define your identifier(s) either in the mapped superclass or in + the subclass entity. </p> <p> The following is an example of this type of inheritance where the <code>Vehicle</code> mapped 1.31 +3 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java Index: EJB3EntityFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -w -r1.30 -r1.31 --- EJB3EntityFacadeLogicImpl.java 21 Jul 2007 13:31:53 -0000 1.30 +++ EJB3EntityFacadeLogicImpl.java 30 Nov 2007 12:14:32 -0000 1.31 @@ -204,6 +204,9 @@ // --------------- methods --------------------- /** + * This was meant to overrides the default implementation in EntityLogicImpl.java. + * TODO: check - is it really required? + * * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade#getIdentifiers() */ public Collection handleGetIdentifiers() |