|
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()
|