You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(178) |
Feb
(169) |
Mar
(286) |
Apr
(117) |
May
(98) |
Jun
(68) |
Jul
(63) |
Aug
(121) |
Sep
(88) |
Oct
(124) |
Nov
(2) |
Dec
(111) |
2007 |
Jan
(224) |
Feb
(69) |
Mar
(10) |
Apr
(72) |
May
(7) |
Jun
(21) |
Jul
(33) |
Aug
(35) |
Sep
(12) |
Oct
(22) |
Nov
(5) |
Dec
(6) |
2008 |
Jan
(2) |
Feb
(10) |
Mar
(39) |
Apr
(58) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(10) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Vance K. <va...@us...> - 2006-01-18 09:16:52
|
User: vancek Date: 06/01/18 01:16:46 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3ScriptHelper.java Log: updated filterUpdatableAttributes method to remove identifier attributes for an entity with a composite primary key class Revision Changes Path 1.3 +6 -3 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java Index: EJB3ScriptHelper.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- EJB3ScriptHelper.java 3 Jan 2006 01:33:44 -0000 1.2 +++ EJB3ScriptHelper.java 18 Jan 2006 09:16:46 -0000 1.3 @@ -1,6 +1,7 @@ package org.andromda.cartridges.ejb3; import org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade; +import org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade; import org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade; import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.metafacades.uml.ModelElementFacade; @@ -58,18 +59,20 @@ /** * Filter a list of EntityAttributes by removing all non-updatable attributes. - * This filter currently removes all attributes that are of stereotype Version. + * This filter currently removes all attributes that are of stereotype Version + * and identifier attributes for an entity with a composite primary key class. * * @param list The original list + * @param isCompositePK True if entity has a composite primary key * @return Collection A list of EntityAttributes from the original list that are updatable */ - public Collection filterUpdatableAttributes(Collection list) + public Collection filterUpdatableAttributes(Collection list, boolean isCompositePK) { Collection retval = new ArrayList(list.size()); for (final Iterator iter = list.iterator(); iter.hasNext(); ) { EJB3EntityAttributeFacade attr = (EJB3EntityAttributeFacade)iter.next(); - if (!attr.isVersion()) + if (!attr.isVersion() && ((isCompositePK && !attr.isIdentifier()) || !isCompositePK)) { retval.add(attr); } |
From: Vance K. <va...@us...> - 2006-01-18 09:15:28
|
User: vancek Date: 06/01/18 01:15:22 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java Log: moved profile definitions for tagged values to profile.xml Revision Changes Path 1.5 +37 -30 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- EJB3Profile.java 17 Jan 2006 04:10:17 -0000 1.4 +++ EJB3Profile.java 18 Jan 2006 09:15:21 -0000 1.5 @@ -38,15 +38,17 @@ * Specifies the create method stereotype - used in entity POJO * and session bean. */ - public static final String STEREOTYPE_CREATE_METHOD = "CreateMethod"; + public static final String STEREOTYPE_CREATE_METHOD = profile.get("CREATE_METHOD"); /** * Specifies the select method stereotype - used in EJB2.x + * This may be deprecated in future releases. */ public static final String STEREOTYPE_SELECT_METHOD = "SelectMethod"; /** * Specifies the environment entry stereotype - used in EJB2.x + * This may be deprecated in future releases. */ public static final String STEREOTYPE_ENV_ENTRY = "EnvEntry"; @@ -61,9 +63,10 @@ public static final String STEREOTYPE_TRANSIENT = profile.get("TRANSIENT"); /** - * Represents a reference to a value object. + * Represents a reference to a value object - used in EJB2.x + * This may be deprecated in furture releases. */ - public static final String STEREOTYPE_VALUE_REF = "ValueRef"; + public static final String STEREOTYPE_VALUE_REF = profile.get("VALUE_REF"); /** * Represents a persistence context instance referenced from a session bean. @@ -111,28 +114,29 @@ /** * The tagged value indicating the EJB query. */ - public static final String TAGGEDVALUE_EJB_QUERY = "@andromda.ejb.query"; + public static final String TAGGEDVALUE_EJB_QUERY = profile.get("QUERY"); /** * The tagged value indicating the view type for the * class or operation. */ - public static final String TAGGEDVALUE_EJB_VIEWTYPE = "@andromda.ejb.viewType"; + public static final String TAGGEDVALUE_EJB_VIEWTYPE = profile.get("VIEW_TYPE"); /** * The tagged value indicating the transaction property. */ - public static final String TAGGEDVALUE_EJB_TRANSACTION_TYPE = "@andromda.ejb.transaction.type"; + public static final String TAGGEDVALUE_EJB_TRANSACTION_TYPE = profile.get("TRANSACTION_TYPE"); /** * The tagged value indicating the transaction demarcation * strategy. This only applies at the class level of a * session bean. */ - public static final String TAGGEDVALUE_EJB_TRANSACTION_MANAGEMENT = "@andromda.ejb.transaction.management"; + public static final String TAGGEDVALUE_EJB_TRANSACTION_MANAGEMENT = profile.get("SERVICE_TRANSACTION_MANAGEMENT"); /** - * + * Used in EJB2.x + * May be deprecated in future releases. */ public static final String TAGGEDVALUE_EJB_NO_SYNTHETIC_CREATE_METHOD = "@andromda.ejb.noSyntheticCreateMethod"; @@ -140,95 +144,92 @@ * The tagged value indicating the finder temporal type. */ public static final String TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_TEMPORAL_TYPE = - "@andromda.persistence.finder.temporal.type"; + profile.get("ENTITY_FINDER_TEMPORAL_TYPE"); /** - * The tagged value indicating the finder result type + * The tagged value indicating the finder method parameter result type * (First or Max). */ public static final String TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_RESULT_TYPE = - "@andromda.persistence.finder.result.type"; + profile.get("ENTITY_FINDER_RESULT_TYPE"); /** * The tagged value indicating the entity table name. */ - public static final String TAGGEDVALUE_PERSISTENCE_ENTITY_TABLE_NAME = "@andromda.persistence.entity.table.name"; + public static final String TAGGEDVALUE_PERSISTENCE_ENTITY_TABLE_NAME = profile.get("TABLE"); /** * The tagged value indicating the fetch type. */ - public static final String TAGGEDVALUE_PERSISTENCE_FETCH_TYPE = "@andromda.persistence.fetch.type"; + public static final String TAGGEDVALUE_PERSISTENCE_FETCH_TYPE = profile.get("FETCH_TYPE"); /** * The tagged value indicating the LOB type. */ - public static final String TAGGEDVALUE_PERSISTENCE_LOB_TYPE = "@andromda.persistence.lob.type"; + public static final String TAGGEDVALUE_PERSISTENCE_LOB_TYPE = profile.get("LOB_TYPE"); /** * The tagged value indicating the cascade type. */ - public static final String TAGGEDVALUE_PERSISTENCE_CASCADE_TYPE = "@andromda.persistence.cascade.type"; + public static final String TAGGEDVALUE_PERSISTENCE_CASCADE_TYPE = profile.get("CASCADE_TYPE"); /** * The tagged value indicating the generator type. */ - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_TYPE = "@andromda.persistence.generator.type"; + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_TYPE = profile.get("GENERATOR_TYPE"); /** * The tagged value indicating the generator name. */ - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_NAME = "@andromda.persistence.generator.name"; + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_NAME = profile.get("GENERATOR_NAME"); /** - * The tagged value indicating the generator source name + * The tagged value indicating the generator source name. */ - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_SOURCE_NAME = - "@andromda.persistence.generator.source.name"; + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_SOURCE_NAME = profile.get("GENERATOR_SOURCE_NAME"); /** * The tagged value indicating the primary key column value for the generator. */ public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_PKCOLUMN_VALUE = - "@andromda.persistence.generator.pkcolumn.value"; + profile.get("GENERATOR_PK_COLUMN_VALUE"); /** * The tagged value indicating the initial value for the generator. */ - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_INITIAL_VALUE = - "@andromda.persistence.generator.initial.value"; + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_INITIAL_VALUE = profile.get("GENERATOR_INITIAL_VALUE"); /** * The tagged value indicating the step size for the generator. */ public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_ALLOCATION_SIZE = - "@andromda.persistence.generator.allocation.size"; + profile.get("GENERATOR_ALLOCATION_SIZE"); /** * The tagged value indicating the SQL definition for a column. */ - public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_DEFINITION = - "@andromda.persistence.column.definition"; + public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_DEFINITION = profile.get("COLUMN_DEFINITION"); /** * The tagged value for the precision in a float/double column. */ - public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_PRECISION = "@andromda.persistence.column.precision"; + public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_PRECISION = profile.get("COLUMN_PRECISION"); /** * The tagged value for the scale in a float/double column. */ - public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_SCALE = "@andromda.persistence.column.scale"; + public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_SCALE = profile.get("COLUMN_SCALE"); /** * The tagged value to represent a column that is nullable. */ - public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_NULLABLE = "@andromda.persistence.column.nullable"; + public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_NULLABLE = profile.get("COLUMN_NULLABLE"); /** * The tagged value that indicates the order by logic on the * Many side of the One-to-Many and Many-to-Many relationships. */ - public static final String TAGGEDVALUE_PERSISTENCE_ORDERBY = "@andromda.persistence.orderBy"; + public static final String TAGGEDVALUE_PERSISTENCE_ORDERBY = profile.get("ORDER_BY"); /** * The tagged value indicating the underlying relationship may @@ -379,4 +380,10 @@ * JNDI name. */ public static final String TAGGEDVALUE_EJB_SESSION_JNDI_NAME_Local = profile.get("SERVICE_JNDI_NAME_LOCAL"); + + /** + * The tagged value indicating the session bean operation as a + * Timer Service timeout callback method. + */ + public static final String TAGGEDVALUE_SERVICE_TIMER_TIMEOUT = profile.get("SERVICE_TIMER_TIMEOUT"); } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-18 08:59:48
|
User: vancek Date: 06/01/18 00:59:37 Modified: andromda-ejb3/src/main/resources/META-INF/andromda profile.xml Log: added missing entity related elements, change @andromda.ejb.* tagged values related to service beans to @andromda.service where appropriate Revision Changes Path 1.5 +293 -12 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- profile.xml 17 Jan 2006 03:27:07 -0000 1.4 +++ profile.xml 18 Jan 2006 08:59:37 -0000 1.5 @@ -83,7 +83,7 @@ constructors are used in EJB3 </documentation> <value>CreateMethod</value> - <appliedOnElement>Entity operation</appliedOnElement> + <appliedOnElement>Entity operation and Session operation</appliedOnElement> </element> <element name="ENTITY_REF"> <documentation> @@ -393,6 +393,253 @@ <![CDATA[<<Entity>>]]> </appliedOnElement> </element> + <element name="ENTITY_FINDER_TEMPORAL_TYPE"> + <documentation> + The temporal type tagged value specified on + the finder method parameter specifying + whether to expect one of the following + types Date, Time or Timestamp. + </documentation> + <value> + @andromda.persistence.finder.temporal.type + </value> + <appliedOnElement> + Entity Finder Method Parameter + </appliedOnElement> + <allowedValues> + <value default="true">DATE</value> + <value>TIME</value> + <value>TIMESTAMP</value> + <value>NONE</value> + </allowedValues> + </element> + <element name="ENTITY_FINDER_RESULT_TYPE"> + <documentation> + Specifies the finder method parameter + result type to specify the limit and/or + starting index. + </documentation> + <value> + @andromda.persistence.finder.result.type + </value> + <appliedOnElement> + Entity Finder Method Parameter + </appliedOnElement> + <allowedValues> + <value default="true">First</value> + <value>Max</value> + </allowedValues> + </element> + <element name="FETCH_TYPE"> + <documentation> + Denotes whether or not to hint to the EJB3 container + that the EJB relationship/property should be lazily + or eagerly loaded. + By default, the loading persistence is EAGER for + attributes and relationships of type OneToOne and + ManyToOne. + Relationships with OneToMany and ManyToMany syntax are + LAZY loaded. You don't need to set anything to + accept these default settings. + </documentation> + <value> + @andromda.persistence.fetch.type + </value> + <appliedOnElement> + Association End or Entity Attribute + </appliedOnElement> + <allowedValues> + <value>LAZY</value> + <value>EAGER</value> + </allowedValues> + </element> + <element name="LOB_TYPE"> + <documentation> + Specifies either binary or character types + for an entity attribute. + BLOB fields represent Byte[] or Serializable types. + CLOB fiels represent char[], Character[] or String + types. + </documentation> + <value> + @andromda.persistence.lob.type + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + <allowedValues> + <value default="true">CLOB</value> + <value>BLOB</value> + </allowedValues> + </element> + <element name="CASCADE_TYPE"> + <documentation> + Specifies the override value for the default + cascade setting for this relationship. + </documentation> + <value> + @andromda.persistence.cascade.type + </value> + <appliedOnElement> + Association End + </appliedOnElement> + <allowedValues> + <value>ALL</value> + <value>PERSIST</value> + <value>MERGE</value> + <value>REMOVE</value> + <value>REFRESH</value> + </allowedValues> + </element> + <element name="GENERATOR_TYPE"> + <documentation> + Specifies the primary key generation strategy + associated with an entity bean attribute identifier. + </documentation> + <value> + @andromda.persistence.generator.type + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + <allowedValues> + <value default="true">AUTO</value> + <value>SEQUENCE</value> + <value>IDENTITY</value> + <value>TABLE</value> + <value>NONE</value> + </allowedValues> + </element> + <element name="GENERATOR_NAME"> + <documentation> + Defines a unique name which is referenced by one + or more classes to be the generator for an + entity bean. + </documentation> + <value> + @andromda.persistence.generator.name + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="GENERATOR_SOURCE_NAME"> + <documentation> + Specifies either the table name that stores the + generated ids or the sequence name which is the + name of the database sequence object used to + get the ids. + </documentation> + <value> + @andromda.persistence.generator.source.name + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="GENERATOR_PK_COLUMN_VALUE"> + <documentation> + The primary key value in the generator table + that identifies the generated value from + other values in the table. + </documentation> + <value> + @andromda.persistence.generator.pkcolumn.value + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="GENERATOR_INITIAL_VALUE"> + <documentation> + Specifies the initial starting sequence for id + generation for an entity PK generator. + </documentation> + <value> + @andromda.persistence.generator.initial.value + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="GENERATOR_ALLOCATION_SIZE"> + <documentation> + Specifies the amount to increment by when + allocating an id number from the generator. + </documentation> + <value> + @andromda.persistence.generator.allocation.size + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="COLUMN_DEFINITION"> + <documentation> + Specifies the SQL to create the DDL for the + column or entity property. + </documentation> + <value> + @andromda.persistence.column.definition + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="COLUMN_PRECISION"> + <documentation> + Specifies the precision value for a decimal + column. + </documentation> + <value> + @andromda.persistence.column.precision + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="COLUMN_SCALE"> + <documentation> + Specifies the scale to use for a decimal + column. + </documentation> + <value> + @andromda.persistence.column.scale + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + </element> + <element name="COLUMN_NULLABLE"> + <documentation> + Specifies whether the underlying column + for the entity attribute may be NULL. + </documentation> + <value> + @andromda.persistence.column.nullable + </value> + <appliedOnElement> + Entity Attribute + </appliedOnElement> + <allowedValues> + <value>true</value> + <value>false</value> + </allowedValues> + </element> + <element name="ORDER_BY"> + <documentation> + Specifies the column name(s) that will be + used for sorting the returned collection, + with ASC or DESC optional. Without a + value, the primary key is assumed. + </documentation> + <value> + @andromda.persistence.orderBy + </value> + <appliedOnElement> + Association End + </appliedOnElement> + </element> <element name="SERVICE_TYPE"> <documentation> Used at the class level of a service bean to @@ -401,7 +648,7 @@ variables. </documentation> <value> - @andromda.ejb.service.type + @andromda.service.type </value> <appliedOnElement> <![CDATA[<<Service>>]]> @@ -419,7 +666,7 @@ name. </documentation> <value> - @andromda.ejb.persistence.context.unit.name + @andromda.service.persistence.context.unit.name </value> <appliedOnElement> <![CDATA[<<Service>>]]> @@ -435,7 +682,7 @@ EntityManager. </documentation> <value> - @andromda.ejb.persistence.context.unit.type + @andromda.service.persistence.context.unit.type </value> <appliedOnElement> <![CDATA[<<Service>>]]> @@ -453,13 +700,13 @@ are applied in a transation. </documentation> <value> - @andromda.ejb.persistence.flush.mode + @andromda.service.persistence.flush.mode </value> <appliedOnElement> Service operation </appliedOnElement> <allowedValues> - <value>AUTO</value> + <value default="true">AUTO</value> <value>COMMIT</value> <value>NEVER</value> </allowedValues> @@ -471,7 +718,7 @@ to. </documentation> <value> - @andromda.ejb.service.jndi.remote + @andromda.service.jndi.remote </value> <appliedOnElement> <![CDATA[<<Service>>]]> @@ -484,12 +731,46 @@ to. </documentation> <value> - @andromda.ejb.service.jndi.local + @andromda.service.jndi.local </value> <appliedOnElement> <![CDATA[<<Service>>]]> </appliedOnElement> </element> + <element name="SERVICE_TIMER_TIMEOUT"> + <documentation> + Specifies whether the session bean operation + as a Timer Service timeout callback method. + </documentation> + <value> + @andromda.service.timer.timeout + </value> + <appliedOnElement> + Service Operation + </appliedOnElement> + <allowedValues> + <value>true</value> + <value>false</value> + </allowedValues> + </element> + <element name="SERVICE_TRANSACTION_MANAGEMENT"> + <documentation> + Specifies the transaction demarcation strategy + for the session bean. By default, this does not + need to be set for CONTAINER managed transaction + demarcation. + </documentation> + <value> + @andromda.service.transaction.management + </value> + <appliedOnElement> + Service + </appliedOnElement> + <allowedValues> + <value default="true">BEAN</value> + <value>CONTAINER</value> + </allowedValues> + </element> <element name="SECURITY_PERMIT_ALL"> <documentation> Specifies whether to permit all roles to @@ -503,7 +784,7 @@ permit all tagged value is rendered. </documentation> <value> - @andromda.ejb.security.permitAll + @andromda.service.security.permitAll </value> <appliedOnElement> Service and service operation @@ -526,7 +807,7 @@ deny all tagged value is rendered. </documentation> <value> - @andromda.ejb.security.denyAll + @andromda.service.security.denyAll </value> <appliedOnElement> Service and service operation @@ -543,10 +824,10 @@ the security realm to match allowed roles. </documentation> <value> - @andromda.ejb.security.realm + @andromda.service.security.realm </value> <appliedOnElement> - Session bean + Service </appliedOnElement> </element> <element name="AUTOMATIC_KEY"> |
From: Vance K. <va...@us...> - 2006-01-18 08:55:13
|
User: vancek Date: 06/01/18 00:55:08 Modified: andromda-ejb3/src/main/resources/META-INF/andromda namespace.xml Log: added entityCompositePrimaryKeyNamePattern and persistenceContextUnitName properties Revision Changes Path 1.7 +14 -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.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- namespace.xml 17 Jan 2006 03:24:09 -0000 1.6 +++ namespace.xml 18 Jan 2006 08:55:07 -0000 1.7 @@ -323,6 +323,13 @@ class name. </documentation> </property> + <property name="entityCompositePrimaryKeyNamePattern"> + <default>{0}PK</default> + <documentation> + The pattern to use when constructing the composite + primary key class name. + </documentation> + </property> <property name="jndiNamePrefix" required="false"> <documentation> The prefix to give to the EJB JNDI names (this @@ -358,6 +365,13 @@ </ul> </documentation> </property> + <property name="persistenceContextUnitName" required="false"> + <documentation> + Specifies the default persistence context + unit name associated with the default Entity + Manager. + </documentation> + </property> <property name="entityAccessType"> <default>PROPERTY</default> <documentation> |
From: Vance K. <va...@us...> - 2006-01-18 08:53:03
|
User: vancek Date: 06/01/18 00:52:56 Modified: andromda-ejb3/src/main/resources/META-INF/andromda metafacades.xml Log: added entityCompositePrimaryKeyNamePattern and persistenceContextUnitName properties Revision Changes Path 1.6 +2 -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.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- metafacades.xml 17 Jan 2006 03:21:22 -0000 1.5 +++ metafacades.xml 18 Jan 2006 08:52:56 -0000 1.6 @@ -7,6 +7,7 @@ <property reference="entityEmbeddableNamePattern" /> <property reference="entityNamePattern" /> <property reference="entityImplementationNamePattern" /> + <property reference="entityCompositePrimaryKeyNamePattern" /> <property reference="entityDefaultCascade" /> <property reference="entityInheritanceStrategy" /> <property reference="entityDiscriminatorType" /> @@ -14,6 +15,7 @@ <property reference="serviceViewType" /> <property reference="entityGenericFinders" /> <property reference="persistenceContainerName" /> + <property reference="persistenceContextUnitName" /> <property reference="securityRealm" /> <!-- Entity EJB Metafacades --> <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3OperationFacadeLogicImpl"> |
From: Vance K. <va...@us...> - 2006-01-18 08:49:57
|
User: vancek Date: 06/01/18 00:49:52 Modified: andromda-ejb3/src/main/resources/META-INF/andromda cartridge.xml Log: added EntityCompositePK.vsl template, uncommented ejb-jar.xml and jboss.xml template elements Revision Changes Path 1.7 +14 -2 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- cartridge.xml 17 Jan 2006 03:20:14 -0000 1.6 +++ cartridge.xml 18 Jan 2006 08:49:51 -0000 1.7 @@ -65,6 +65,20 @@ </template> <template + path="templates/ejb3/EntityCompositePK.vsl" + outputPattern="$generatedFile" + outlet="entity-beans" + overwrite="true"> + <modelElements variable="entity"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade"> + <property name="compositePrimaryKeyPresent">true</property> + </type> + </modelElement> + </modelElements> + </template> + + <template path="templates/ejb3/persistence.xml.vsl" outputPattern="META-INF/persistence.xml" outlet="entity-config" @@ -172,7 +186,6 @@ </modelElements> </template> - <!-- <template path="templates/ejb3/ejb-jar.xml.vsl" outputPattern="META-INF/ejb-jar.xml" @@ -200,7 +213,6 @@ </modelElement> </modelElements> </template> - --> <!-- Message Driven Bean Templates --> |
From: Vance K. <va...@us...> - 2006-01-18 08:48:48
|
User: vancek Date: 06/01/18 00:48:42 Modified: andromda-ejb3/src/main/resources/templates/ejb3 EntityEmbeddable.vsl Log: introduced composite primary key, fixed findByPrimaryKey for non-primitive types Revision Changes Path 1.2 +89 -29 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.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EntityEmbeddable.vsl 17 Jan 2006 04:11:21 -0000 1.1 +++ EntityEmbeddable.vsl 18 Jan 2006 08:48:42 -0000 1.2 @@ -55,9 +55,20 @@ // ----------- Attribute Definitions ------------ +#if ($entity.compositePrimaryKeyPresent) + private ${entity.fullyQualifiedEntityCompositePrimaryKeyName} pk; +#end +## Only include identifier attributes if a composite primary key is NOT present #**##foreach ($attribute in $attributes) +#* *##if ($entity.compositePrimaryKeyPresent && $attribute.identifier) +#* *##set ($doAttribute = false) +#* *##else +#* *##set ($doAttribute = true) +#* *##end +#* *##if ($doAttribute) private $attribute.type.fullyQualifiedName $attribute.name; #**##end +#**##end #end #set ($entityRelations = $entity.allEntityRelations) #if (!$entityRelations.empty) @@ -87,22 +98,21 @@ #set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) #set ($inheritedAttributes = $transform.filterByVisibility($entity.inheritedInstanceAttributes, "public")) #set ($instanceAttributes = $transform.filterByVisibility($entity.instanceAttributes, "public")) - /** * Implementation for the main constructor with all POJO attributes. * This method sets all POJO fields defined in this class to the * values provided by the parameters. * -#foreach($attribute in $transform.filterUpdatableAttributes($allAttributes)) +#foreach($attribute in $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) * @param $attribute.name Value for the ${attribute.name} property #end */ - public ${entity.entityEmbeddableName}($entity.getAttributesAsList($allAttributes, true, true)) + public ${entity.entityEmbeddableName}($entity.getAttributesAsList($allAttributes, true, true, false)) { #if(!$inheritedAttributes.empty) - super($entity.getAttributesAsList($inheritedAttributes, false, true)); + super($entity.getAttributesAsList($inheritedAttributes, false, true, false)); #end -#foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) +#foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes, $entity.compositePrimaryKeyPresent)) ${attribute.setterName}(${attribute.name}); #end } @@ -119,10 +129,10 @@ * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation role #* *##end */ - public ${entity.entityEmbeddableName}($entity.getAttributesAsList($allAttributes, true, true)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)#if ($relation.one2Many || $relation.many2Many)${relation.relationType}<${relation.otherEnd.type.name}> $relation.otherEnd.name#else${relation.relationType} $relation.otherEnd.name#end#if($velocityCount != $relations.size()), #end#end) + public ${entity.entityEmbeddableName}($entity.getAttributesAsList($allAttributes, true, true, false)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)#if ($relation.one2Many || $relation.many2Many)${relation.relationType}<${relation.otherEnd.type.name}> $relation.otherEnd.name#else${relation.relationType} $relation.otherEnd.name#end#if($velocityCount != $relations.size()), #end#end) { // Call suitable class constructor - this($entity.getAttributesAsList($allAttributes, false, true)); + this($entity.getAttributesAsList($allAttributes, false, true, false)); // Set the CMR relations #* *##foreach ($relation in $relations) @@ -147,6 +157,19 @@ this.${attribute} = $attribute; #**##end } + +#end +#if ($entity.compositePrimaryKeyPresent) + /** + * Constructor with composite primary key arg only + * + * @param pk Composite primary key + */ + public ${entity.entityEmbeddableName}(${entity.fullyQualifiedEntityCompositePrimaryKeyName} pk) + { + this.pk = pk; + } + #end #if (!$constants.empty) @@ -161,13 +184,47 @@ { return $constant.name; } + #**##end #end +#if ($entity.compositePrimaryKeyPresent) + + // ----- Composite PK Accessors ------ + + /** + * Return the composite primary key for ${entity.entityName} + * + * @return The composite primary key + */ + @javax.persistence.EmbeddedId + public ${entity.fullyQualifiedEntityCompositePrimaryKeyName} getPk() + { + return this.pk; + } + + /** + * Set the composite primary key for ${entity.entityName} + * + * @param pk The composite primary key + */ + public void setPk(${entity.fullyQualifiedEntityCompositePrimaryKeyName} pk) + { + this.pk = pk; + } + +#end #if (!$attributes.empty) // -------- Attribute Accessors ---------- #**##foreach ($attribute in $entity.attributes) +## Only include accessors for identifier attributes if entity does not have a composite primary key +#* *##if ($entity.compositePrimaryKeyPresent && $attribute.identifier) +#* *##set ($doAttributeAccessors = false) +#* *##else +#* *##set ($doAttributeAccessors = true) +#* *##end +#* *##if ($doAttributeAccessors) #* *##set ($visibility = $attribute.visibility) /** * Get the $attribute.name property. @@ -211,6 +268,7 @@ } #**##end +#**##end #end // ------------- Relations ------------------ @@ -363,11 +421,12 @@ { return em.createQuery("FROM ${entity.tableName} AS $stringUtils.uncapitalize(${entity.name})").getResultList(); } - -#**##foreach ($attribute in $entity.attributes) -#* *##if ($attribute.identifier) +#**##if (!$entity.compositePrimaryKeyPresent) +#**##foreach ($attribute in $entity.getIdentifiers(false)) #* *##set ($identifierName = $attribute.name) #* *##set ($identifierType = $attribute.type.fullyQualifiedName) +#* *##set ($identifierTypePrimitive = $attribute.type.primitive) +#* *##if ($attribute.type.primitive) #* *##set ($identifierTypeWrapperName = $attribute.type.wrapperName) #* *##end #**##end @@ -380,9 +439,10 @@ */ public static ${entity.fullyQualifiedEntityName} findByPrimaryKey(javax.persistence.EntityManager em, ${identifierType} ${identifierName}) { -## Identifier will always be a primitive type - return em.find(${entity.fullyQualifiedEntityName}.class, new ${identifierTypeWrapperName}(${identifierName})); +## If the identifier is a primitive type, use the wrapper class + return em.find(${entity.fullyQualifiedEntityName}.class,#if ($identifierTypePrimitive) new ${identifierTypeWrapperName}(${identifierName})#else ${identifierName}#end); } +#**##end #end #set ($finders = $entity.getQueryOperations(true)) #if (!$finders.empty) |
From: Vance K. <va...@us...> - 2006-01-18 08:46:11
|
User: vancek Date: 06/01/18 00:46:04 Added: andromda-ejb3/src/main/resources/templates/ejb3 EntityCompositePK.vsl Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityCompositePK.vsl Index: EntityCompositePK.vsl =================================================================== // license-header java merge-point /* Autogenerated by AndroMDA (EntityCompositePK.vsl) - do not edit */ #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end #set ($generatedFile = "${stringUtils.replace($entity.fullyQualifiedEntityCompositePrimaryKeyName,'.','/')}.java") /** * Composite primary key class for ${entity.entityName} entity bean. $entity.getDocumentation(" * ") */ @javax.persistence.Embeddable public class ${entity.entityCompositePrimaryKeyName} implements java.io.Serializable { private static final long serialVersionUID = 1L; #set ($identifiers = $entity.getIdentifiers()) #foreach ($attribute in $identifiers) private $attribute.type.fullyQualifiedName $attribute.name; #end public ${entity.entityCompositePrimaryKeyName}() { // default null constructor } /** * Implementation for the main constructor with all POJO identifier attributes. * #foreach($attribute in $identifiers) * @param $attribute.name Value for the ${attribute.name} property #end */ public ${entity.entityCompositePrimaryKeyName}($entity.getAttributesAsList($identifiers, true, true, true)) { #foreach ($attribute in $identifiers) ${attribute.setterName}(${attribute.name}); #end } #foreach ($attribute in $identifiers) #**##set ($visibility = $attribute.visibility) /** * Get the $attribute.name property. $attribute.getDocumentation(" * ") * @return $attribute.type.fullyQualifiedName The value of ${attribute.name} */ public $attribute.type.fullyQualifiedName ${attribute.getterName}() { return $attribute.name; } /** * Set the $attribute.name property. * @param value the new value */ public void ${attribute.setterName}($attribute.type.fullyQualifiedName value) { this.${attribute.name} = value; } #end public int hashCode() { int result = 0; #foreach($attribute in $identifiers) #**##if ($attribute.type.primitive) #* *##if ($attribute.type.fullyQualifiedName == "java.lang.boolean") result = 37*result + (this.${attribute.name} ? 0 : 1); #* *##else result = 37*result + (int)this.${attribute.name}; #* *##end #**##else result = 37*result + ((this.${attribute.name} != null) ? this.${attribute.name}.hashCode() : 0); #**##end #end return result; } public boolean equals(Object object) { if (object == this) { return true; } if (!(object instanceof ${entity.entityCompositePrimaryKeyName})) { return false; } if (object == null) { return false; } ${entity.entityCompositePrimaryKeyName} pk = (${entity.entityCompositePrimaryKeyName})object; return #set ($totalIdentifiers = $identifiers.size()) #foreach($attribute in $identifiers) #**##if ($attribute.type.fullyQualifiedName == "java.lang.String") #if ($velocityCount > 1)&&#end pk.${attribute.name}.equals(this.${attribute.name})#if ($velocityCount == $totalIdentifiers);#end #**##else #if ($velocityCount > 1)&&#end pk.${attribute.name} == this.${attribute.name}#if ($velocityCount == $totalIdentifiers);#end #**##end #end } } |
From: Vance K. <va...@us...> - 2006-01-18 08:45:41
|
User: vancek Date: 06/01/18 00:45:33 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: getAttributesAsList method contains extra args to determine if to include identifiers if composite primary key exsits Revision Changes Path 1.5 +2 -2 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- Entity.vsl 17 Jan 2006 04:12:54 -0000 1.4 +++ Entity.vsl 18 Jan 2006 08:45:33 -0000 1.5 @@ -51,9 +51,9 @@ * @param $attribute.name Value for the ${attribute.name} property #end */ - public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)) + public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true, false)) { - super($entity.getAttributesAsList($allAttributes, false, true)); + super($entity.getAttributesAsList($allAttributes, false, true, false)); } #foreach ($operation in $entity.getCreateMethods(true)) |
From: Vance K. <va...@us...> - 2006-01-18 08:43:28
|
User: vancek Date: 06/01/18 00:43:22 Modified: andromda-ejb3/src/main/resources/templates/ejb3 jboss.xml.vsl ejb-jar.xml.vsl Log: only adds remote or local elements/jndi names if the corresponding interface exists Revision Changes Path 1.2 +4 -0 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/jboss.xml.vsl Index: jboss.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/jboss.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- jboss.xml.vsl 17 Jan 2006 03:05:58 -0000 1.1 +++ jboss.xml.vsl 18 Jan 2006 08:43:20 -0000 1.2 @@ -9,8 +9,12 @@ #foreach ($service in $services) <session> <ejb-name>$service.serviceName</ejb-name> +#**##if ($service.viewTypeRemote) <jndi-name>#if ($service.jndiNameRemote)${service.jndiNameRemote}#else${service.fullyQualifiedServiceRemoteInterfaceName}#end</jndi-name> +#**##end +#**##if ($service.viewTypeLocal) <local-jndi-name>#if ($service.jndiNameLocal)${service.jndiNameLocal}#else${service.fullyQualifiedServiceLocalInterfaceName}#end</local-jndi-name> +#**##end </session> #end 1.2 +4 -0 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/ejb-jar.xml.vsl Index: ejb-jar.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/ejb-jar.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- ejb-jar.xml.vsl 17 Jan 2006 03:05:58 -0000 1.1 +++ ejb-jar.xml.vsl 18 Jan 2006 08:43:20 -0000 1.2 @@ -17,8 +17,12 @@ ]]> </description> <ejb-name>$service.serviceName</ejb-name> +#**##if ($service.viewTypeRemote) <remote>${service.fullyQualifiedServiceRemoteInterfaceName}</remote> +#**##end +#**##if ($service.viewTypeLocal) <local>${service.fullyQualifiedServiceLocalInterfaceName}</local> +#**##end <ejb-class>${service.fullyQualifiedServiceImplementationName}</ejb-class> <session-type>${service.type}</session-type> <transaction-type>Container</transaction-type> |
From: Vance K. <va...@us...> - 2006-01-17 04:13:01
|
User: vancek Date: 06/01/16 20:12:54 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: IMPORTANT: now used as the entity implementation class - refer to EntityEmbeddable.vsl for base entity class Revision Changes Path 1.4 +40 -354 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- Entity.vsl 6 Jan 2006 13:46:06 -0000 1.3 +++ Entity.vsl 17 Jan 2006 04:12:54 -0000 1.4 @@ -1,137 +1,60 @@ // license-header java merge-point -/* Autogenerated by AndroMDA (Entity.vsl) - do not edit */ +/* Autogenerated by AndroMDA (EntityImpl.vsl)*/ #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end +#set ($generatedFile = "${stringUtils.replace($entity.fullyQualifiedEntityName,'.','/')}.java") #set ($identifier = $entity.identifiers.iterator().next()) /** - * Autogenerated POJO EJB3 super class for ${entity.entityName} containing the - * bulk of the entity implementation. + * Autogenerated POJO EJB3 implementation class for ${entity.entityName}. * - * This is an abstract super class and autogenerated by AndroMDA using the EJB3 - * cartridge. - * - * DO NOT MODIFY this class. + * Add any manual implementation within this class. This class will NOT + * be overwritten with incremental changes. * $entity.getDocumentation(" * ") * */ -#if ($entity.embeddableSuperclass) -...@ja...rsistence.EmbeddableSuperclass#if ($entity.accessType)(access = javax.persistence.AccessType.${entity.accessType})#end -#else @javax.persistence.Entity#if ($entity.accessType)(access = javax.persistence.AccessType.${entity.accessType})#end -...@ja...rsistence.EntityListener(${entity.fullyQualifiedEntityListenerName}.class) -...@ja...rsistence.Table(name = "${entity.tableName}") -#**##if ($entity.requiresSpecializationMapping) -...@ja...heritance(strategy = javax.persistence.InheritanceType.${entity.inheritanceStrategy}, discriminatorType = javax.persistence.DiscriminatorType.${entity.discriminatorType}#if ($entity.discriminatorValue), discriminatorValue = "${entity.discriminatorValue}"#end) -#* *##if ($entity.inheritanceSingleTable || $entity.inheritanceJoined) -...@ja...rsistence.DiscriminatorColumn(name = "${entity.discriminatorColumn}"#if ($entity.discriminatorColumnDefinition), columnDefinition = "${entity.discriminatorColumnDefinition}"#end#if ($entity.discriminatorLength > 0), length = ${entity.discriminatorLength}#end) -#* *##end -#**##elseif ($entity.requiresGeneralizationMapping) -...@ja...heritance#if ($entity.discriminatorValue)(discriminatorValue = "${entity.discriminatorValue}")#end - -#**##end -#end -public abstract class ${entity.entityName} -#if($entity.generalization) - extends ${entity.generalization.fullyQualifiedName} -#end +public#if ($entity.abstract) abstract#end class ${entity.entityName} + extends ${entity.fullyQualifiedEntityEmbeddableName} implements java.io.Serializable { + /** + * The serial version UID of this class required for serialization. + */ private static final long serialVersionUID = ${entity.serialVersionUID}L; -#set ($constants = $entity.getConstants(true)) -#if (!$constants.empty) - - // ----------- Constant Definitions ------------- - -#**##foreach($constant in $constants) - @javax.persistence.Transient - private static final $constant.type.fullyQualifiedName $constant.name = $constant.defaultValue; -#**##end -#end -#set ($attributes = $entity.attributes) -#if (!$attributes.empty) - - // ----------- Attribute Definitions ------------ - -#**##foreach ($attribute in $attributes) - private $attribute.type.fullyQualifiedName $attribute.name; -#**##end -#end -#set ($entityRelations = $entity.allEntityRelations) -#if (!$entityRelations.empty) - - // --------- Relationship Definitions ----------- - -#**##foreach ($associationEnd in $entityRelations) -#**##**##if ($associationEnd.one2Many || $associationEnd.many2Many) - private $associationEnd.relationType<${associationEnd.otherEnd.type.name}> ${associationEnd.otherEnd.name}; -#**##**##else - private $associationEnd.relationType ${associationEnd.otherEnd.name}; -#**##**##end -#**##end -#end - // --------------- Constructors ----------------- + // --------------- constructors ----------------- + /** + * Default ${entity.name} constructor + */ public ${entity.entityName}() { - // default null constructor + super(); } ## Autogenerate a constructor implementation with all attributes. -#set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) -#set ($inheritedAttributes = $transform.filterByVisibility($entity.inheritedInstanceAttributes, "public")) #set ($instanceAttributes = $transform.filterByVisibility($entity.instanceAttributes, "public")) - +#set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) /** * Implementation for the main constructor with all POJO attributes. - * This method sets all POJO fields defined in this class to the + * This method sets all POJO fields defined in this/super class to the * values provided by the parameters. * -#foreach($attribute in $transform.filterUpdatableAttributes($allAttributes)) +#foreach($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) * @param $attribute.name Value for the ${attribute.name} property #end */ public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)) { -#if(!$inheritedAttributes.empty) - super($entity.getAttributesAsList($inheritedAttributes, false, true)); -#end -#foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) - ${attribute.setterName}(${attribute.name}); -#end - } - -#set ($relations = $entity.allEntityRelations) -#if (!$relations.empty) -#**##if ($entity.syntheticCreateMethodAllowed) - /** - * Constructor with all POJO attribute values and CMR relations. -#* *##foreach($attribute in $allAttributes) - * @param $attribute.name Value for the $attribute.name property -#* *##end -#* *##foreach ($relation in $relations) - * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation role -#* *##end - */ - public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)#if ($relation.one2Many || $relation.many2Many)${relation.relationType}<${relation.otherEnd.type.name}> $relation.otherEnd.name#else${relation.relationType} $relation.otherEnd.name#end#if($velocityCount != $relations.size()), #end#end) - { - // Call suitable class constructor - this($entity.getAttributesAsList($allAttributes, false, true)); - - // Set the CMR relations -#* *##foreach ($relation in $relations) - ${relation.otherEnd.setterName}($relation.otherEnd.name); -#* *##end + super($entity.getAttributesAsList($allAttributes, false, true)); } -#**##end -#end #foreach ($operation in $entity.getCreateMethods(true)) #**##set ($opArguments = $transform.getArgumentsAsList(${operation.argumentNames})) @@ -144,276 +67,39 @@ */ public ${entity.entityName}(${operation.typedArgumentList}) { -#**##foreach($attribute in $opArguments) - this.${attribute} = $attribute; -#**##end - } -#end - - // --------- Constant Accessors ---------- -#foreach($constant in $entity.getConstants(true)) - /** - * Get the <code>$constant.name</code> constant -$constant.getDocumentation(" * ") - * - $constant.visibility $constant.type.fullyQualifiedName ${constant.getterName}() - { - return $constant.name; - } -#end -#if (!$attributes.empty) - - // -------- Attribute Accessors ---------- - -#**##foreach ($attribute in $entity.attributes) -#* *##set ($visibility = $attribute.visibility) - /** - * Get the $attribute.name property. -$attribute.getDocumentation(" * ") - * @return $attribute.type.fullyQualifiedName The value of ${attribute.name} - */ -#* *##if ($attribute.identifier) -#* *##if ($attribute.sequenceGeneratorType || $attribute.tableGeneratorType) - @javax.persistence.TableGenerator(name = "${attribute.generatorName}"#if ($attribute.sequenceGeneratorType), sequenceName = "${attribute.generatorSourceName}"#elseif ($attribute.tableGeneratorType), tableName = "${attribute.generatorSourceName}"#end,#if ($attribute.tableGeneratorType) pkColumnValue = "${attribute.generatorPkColumnValue}",#end#if ($attribute.sequenceGeneratorType) initialValue = ${attribute.generatorInitialValue},#end allocationSize = ${attribute.generatorAllocationSize}) -#* *##end - @javax.persistence.Id(generate = javax.persistence.GeneratorType.${attribute.generatorType}#if ($attribute.sequenceGeneratorType || $attribute.tableGeneratorType), generator = "${attribute.generatorName}"#end) -#* *##end -#* *##if ($attribute.version) - @javax.persistence.Version -#* *##end -#* *##if ($attribute.transient) - @javax.persistence.Transient -#* *##end -#* *##if ($attribute.lobType) -## LOB type is specified - also sepcify FetchType if set to EAGER since default fetch type for LOB annotation is LAZY - @javax.persistence.Lob(type = javax.persistence.LobType.${attribute.lobType}#if ($attribute.eager), fetch = javax.persistence.FetchType.EAGER#end) -#* *##end - @javax.persistence.Column(name = "${attribute.columnName}"#if ($attribute.unique), unique = ${attribute.unique}#end#if (!$attribute.columnNullable), nullable = ${attribute.columnNullable}#end#if ($attribute.columnLength), length = ${attribute.columnLength}#end#if ($attribute.columnDefinition), columnDefinition = "${attribute.columnDefinition}"#end#if ($attribute.columnPrecision), precision = ${attribute.columnPrecision}#end#if ($attribute.columnScale), scale = ${attribute.columnScale}#end) -## Only add the fetch type property for LAZY hints - default is EAGER -#* *##if ($attribute.lazy) - @javax.persistence.Basic(fetch = javax.persistence.FetchType.LAZY) -#* *##end - public $attribute.type.fullyQualifiedName ${attribute.getterName}() - { - return $attribute.name; - } - -## Allow only if not a version attribute since they are set by the container - No setter method is made available -#* *##if (!$attribute.version) - /** - * Set the $attribute.name property. - * @param value the new value - */ - public void ${attribute.setterName}($attribute.type.fullyQualifiedName value) - { - this.${attribute.name} = value; - } -#* *##end - -#**##end -#end - - // ------------- Relations ------------------ - -#foreach ($associationEnd in $entity.allEntityRelations) -#**##set ($target = $associationEnd.otherEnd) -#**##if($target.navigable) -#* *##if ($associationEnd.many2One) -## -## MANY TO ONE RELATIONSHIP -## -## Default fetch type: EAGER -## - /** - * Get the ${target.name} - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.ManyToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) - @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) - public $associationEnd.relationType ${target.getterName}() - { - return this.${target.name}; - } - -#* *##if(!$target.readOnly) - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName}($associationEnd.relationType ${target.name}) - { - this.${target.name} = ${target.name}; - } -#* *##end -#* *##elseif ($associationEnd.one2Many) -## -## ONE TO MANY RELATIONSHIP -## -## Include the mappedBy element for bidirection relationships ONLY -## Default fetch type: LAZY -## If orderBy element is not specified, container assumes PK ordering -## - /** - * Get the ${target.name} Collection - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.OneToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($associationEnd.navigable)#if ($argExists) ,#end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) -#* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) -#* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) - @javax.persistence.OrderBy("${target.orderByClause}") -#* *##else - @javax.persistence.OrderBy -#* *##end -#* *##end - public $associationEnd.relationType<${target.type.name}> ${target.getterName}() - { - return this.${target.name}; - } - - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName} (${associationEnd.relationType}<${target.type.name}> ${target.name}) - { - this.${target.name} = ${target.name}; - } -#* *##elseif ($associationEnd.one2One) -## -## ONE TO ONE RELATIONSHIP -## -## Default fetch type: EAGER -## - /** - * Get the ${target.name} - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.OneToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if(!$associationEnd.owning)#if ($argExists), #end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) -#* *##if($associationEnd.owning) - @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) -#* *##end - public $associationEnd.relationType ${target.getterName}() - { - return this.${target.name}; - } - -#* *##if(!$target.readOnly) - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName}($associationEnd.relationType ${target.name}) - { - this.${target.name} = ${target.name}; - } -#* *##end -#* *##elseif ($associationEnd.many2Many) -## -## MANY TO MANY RELATIONSHIP -## -## Default fetch type: LAZY -## - /** - * Get the ${target.name} Collection - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.ManyToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) -## Use Aggregation and Composition to determine owning side -#* *##if(($associationEnd.owning) && ${associationEnd.association.tableName}) - @javax.persistence.JoinTable(table = @javax.persistence.Table(name = "${associationEnd.association.tableName}")) -#* *##end -#* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) -#* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) - @javax.persistence.OrderBy("${target.orderByClause}") -#* *##else - @javax.persistence.OrderBy -#* *##end -#* *##end - public $associationEnd.relationType<${target.type.name}> ${target.getterName}() - { - return this.${target.name}; - } - - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName} (${associationEnd.relationType}<${target.type.name}> ${target.name}) - { - this.${target.name} = ${target.name}; + super(${operation.argumentNames}); } -#* *##end -#**##end #end - - // ----------------- Finder Method ------------------ - -#foreach ($finder in $entity.getQueryOperations(true)) -#**##set ($returnType = $finder.returnType.fullyQualifiedName) -#**##set ($parameterList = $finder.typedArgumentList) -#**##if ($finder.arguments.empty) -#* *##set ($parameters = "javax.persistence.EntityManager em") -#**##else -#* *##set ($parameters = "javax.persistence.EntityManager em, ${parameterList}") -#**##end - /** -$finder.getDocumentation(" * ") - * - * Finder method for ${entity.name} entity using a query. - * @param em javax.persistence.EntityManager -#**##foreach ($parameter in $finder.arguments) - * @param $parameter.type.fullyQualifiedName ${parameter.name} -#**##end - * @return $returnType - */ - $finder.visibility static $returnType#if ($returnType == "java.util.Collection" || $returnType == "java.util.List")<${entity.name}>#end ${finder.name}($parameters) - { - javax.persistence.Query query = em.createQuery("$finder.query"); -#**##foreach ($parameter in $finder.arguments) -#* *##set ($index = $velocityCount - 1) -#* *##if ($parameter.firstResult) - query.setFirstResult(${parameter.name}); -#* *##elseif ($parameter.maxResults) - query.setMaxResults(${parameter.name}); -#* *##else -#* *##if ($finder.useNamedParameters) - query.setParameter("${parameter.name}",#if ($parameter.type.primitive) new ${parameter.type.wrapperName}(${parameter.name})#else ${parameter.name}#end#if ($parameter.temporalType), javax.persistence.TemporalType.${parameter.temporalType}#end); -#* *##else - query.setParameter(${index},#if ($parameter.type.primitive) new ${parameter.type.wrapperName}(${parameter.name})#else ${parameter.name}#end#if ($parameter.temporalType), javax.persistence.TemporalType.${parameter.temporalType}#end); -#* *##end -#* *##end -#**##end -#**##if ($finder.returnType.primitive) - return (($finder.returnType.wrapperName)query.getSingleResult()).${returnType}Value(); -#**##elseif (!$finder.returnType.collectionType) - return ($returnType)query.getSingleResult(); -#**##else - return query.getResultList(); -#**##end - } - -#end## finder operations -#set ($businessOperations = $entity.businessOperations) -#if (!$businessOperations.empty) +#set ($operations = $entity.businessOperations) +#if (!$operations.empty) // --------------- Business Methods ----------------- -#**##foreach ($operation in ) +#**##foreach ($operation in $operations) #* *##set ($signature = $operation.signature) +#* *##set ($interfaceType = "interface") #* *##set ($visibility = $operation.visibility.toString()) /** $operation.getDocumentation(" * ") */ #* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##if ($operation.exceptionsPresent) - $visibility abstract $returnType $signature - throws $operation.exceptionList; + $visibility $returnType $signature + throws $operation.exceptionList + { + // TODO put your implementation here. +#* *##if ($operation.returnTypePresent) + return $operation.returnType.javaNullString; +#* *##end + } #* *##else - $visibility abstract $returnType $signature; + $visibility $returnType $signature + { + // TODO put your implementation here. +#* *##if ($operation.returnTypePresent) + return $operation.returnType.javaNullString; +#* *##end + } #* *##end #**##end #end |
From: Vance K. <va...@us...> - 2006-01-17 04:11:28
|
User: vancek Date: 06/01/16 20:11:21 Added: andromda-ejb3/src/main/resources/templates/ejb3 EntityEmbeddable.vsl Log: initial revision - this is the abstract entity base class Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityEmbeddable.vsl Index: EntityEmbeddable.vsl =================================================================== // license-header java merge-point /* Autogenerated by AndroMDA (Entity.vsl) - do not edit */ #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end #set ($generatedFile = "${stringUtils.replace($entity.fullyQualifiedEntityEmbeddableName,'.','/')}.java") #set ($identifier = $entity.identifiers.iterator().next()) /** * Autogenerated POJO EJB3 super class for ${entity.entityName} containing the * bulk of the entity implementation. * * This is an embeddable super class and autogenerated by AndroMDA using the EJB3 * cartridge. * * DO NOT MODIFY this class. * $entity.getDocumentation(" * ") * */ @javax.persistence.EmbeddableSuperclass#if ($entity.accessType)(access = javax.persistence.AccessType.${entity.accessType})#end @javax.persistence.EntityListener(${entity.fullyQualifiedEntityListenerName}.class) @javax.persistence.Table(name = "${entity.tableName}") #if ($entity.requiresSpecializationMapping) @javax.persistence.Inheritance(strategy = javax.persistence.InheritanceType.${entity.inheritanceStrategy}, discriminatorType = javax.persistence.DiscriminatorType.${entity.discriminatorType}#if ($entity.discriminatorValue), discriminatorValue = "${entity.discriminatorValue}"#end) #**##if ($entity.inheritanceSingleTable || $entity.inheritanceJoined) @javax.persistence.DiscriminatorColumn(name = "${entity.discriminatorColumn}"#if ($entity.discriminatorColumnDefinition), columnDefinition = "${entity.discriminatorColumnDefinition}"#end#if ($entity.discriminatorLength > 0), length = ${entity.discriminatorLength}#end) #**##end #elseif ($entity.requiresGeneralizationMapping) @javax.persistence.Inheritance#if ($entity.discriminatorValue)(discriminatorValue = "${entity.discriminatorValue}")#end #end public abstract class ${entity.entityEmbeddableName} #if($entity.generalization) extends ${entity.generalization.fullyQualifiedName} #end implements java.io.Serializable { private static final long serialVersionUID = ${entity.serialVersionUID}L; #set ($constants = $entity.getConstants(true)) #if (!$constants.empty) // ----------- Constant Definitions ------------- #**##foreach($constant in $constants) @javax.persistence.Transient private static final $constant.type.fullyQualifiedName $constant.name = $constant.defaultValue; #**##end #end #set ($attributes = $entity.attributes) #if (!$attributes.empty) // ----------- Attribute Definitions ------------ #**##foreach ($attribute in $attributes) private $attribute.type.fullyQualifiedName $attribute.name; #**##end #end #set ($entityRelations = $entity.allEntityRelations) #if (!$entityRelations.empty) // --------- Relationship Definitions ----------- #**##foreach ($associationEnd in $entityRelations) #**##**##if ($associationEnd.one2Many || $associationEnd.many2Many) private $associationEnd.relationType<${associationEnd.otherEnd.type.name}> ${associationEnd.otherEnd.name}; #**##**##else private $associationEnd.relationType ${associationEnd.otherEnd.name}; #**##**##end #**##end #end // --------------- Constructors ----------------- /** * Default empty constructor */ public ${entity.entityEmbeddableName}() { // default null constructor } ## Autogenerate a constructor implementation with all attributes. #set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) #set ($inheritedAttributes = $transform.filterByVisibility($entity.inheritedInstanceAttributes, "public")) #set ($instanceAttributes = $transform.filterByVisibility($entity.instanceAttributes, "public")) /** * Implementation for the main constructor with all POJO attributes. * This method sets all POJO fields defined in this class to the * values provided by the parameters. * #foreach($attribute in $transform.filterUpdatableAttributes($allAttributes)) * @param $attribute.name Value for the ${attribute.name} property #end */ public ${entity.entityEmbeddableName}($entity.getAttributesAsList($allAttributes, true, true)) { #if(!$inheritedAttributes.empty) super($entity.getAttributesAsList($inheritedAttributes, false, true)); #end #foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) ${attribute.setterName}(${attribute.name}); #end } #set ($relations = $entity.allEntityRelations) #if (!$relations.empty) #**##if ($entity.syntheticCreateMethodAllowed) /** * Constructor with all POJO attribute values and CMR relations. #* *##foreach($attribute in $allAttributes) * @param $attribute.name Value for the $attribute.name property #* *##end #* *##foreach ($relation in $relations) * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation role #* *##end */ public ${entity.entityEmbeddableName}($entity.getAttributesAsList($allAttributes, true, true)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)#if ($relation.one2Many || $relation.many2Many)${relation.relationType}<${relation.otherEnd.type.name}> $relation.otherEnd.name#else${relation.relationType} $relation.otherEnd.name#end#if($velocityCount != $relations.size()), #end#end) { // Call suitable class constructor this($entity.getAttributesAsList($allAttributes, false, true)); // Set the CMR relations #* *##foreach ($relation in $relations) ${relation.otherEnd.setterName}($relation.otherEnd.name); #* *##end } #**##end #end #foreach ($operation in $entity.getCreateMethods(true)) #**##set ($opArguments = $transform.getArgumentsAsList(${operation.argumentNames})) /** * Explicitly defined constuctor with specified args list. $operation.getDocumentation(" * ") #**##foreach($attribute in $opArguments) * @param $attribute Value for the $attribute property #**##end */ public ${entity.entityEmbeddableName}(${operation.typedArgumentList}) { #**##foreach($attribute in $opArguments) this.${attribute} = $attribute; #**##end } #end #if (!$constants.empty) // --------- Constant Accessors ---------- #**##foreach($constant in $constants) /** * Get the <code>$constant.name</code> constant $constant.getDocumentation(" * ") * $constant.visibility $constant.type.fullyQualifiedName ${constant.getterName}() { return $constant.name; } #**##end #end #if (!$attributes.empty) // -------- Attribute Accessors ---------- #**##foreach ($attribute in $entity.attributes) #* *##set ($visibility = $attribute.visibility) /** * Get the $attribute.name property. $attribute.getDocumentation(" * ") * @return $attribute.type.fullyQualifiedName The value of ${attribute.name} */ #* *##if ($attribute.identifier) #* *##if ($attribute.sequenceGeneratorType || $attribute.tableGeneratorType) @javax.persistence.TableGenerator(name = "${attribute.generatorName}"#if ($attribute.sequenceGeneratorType), sequenceName = "${attribute.generatorSourceName}"#elseif ($attribute.tableGeneratorType), tableName = "${attribute.generatorSourceName}"#end,#if ($attribute.tableGeneratorType) pkColumnValue = "${attribute.generatorPkColumnValue}",#end#if ($attribute.sequenceGeneratorType) initialValue = ${attribute.generatorInitialValue},#end allocationSize = ${attribute.generatorAllocationSize}) #* *##end @javax.persistence.Id(generate = javax.persistence.GeneratorType.${attribute.generatorType}#if ($attribute.sequenceGeneratorType || $attribute.tableGeneratorType), generator = "${attribute.generatorName}"#end) #* *##end #* *##if ($attribute.version) @javax.persistence.Version #* *##end #* *##if ($attribute.transient) @javax.persistence.Transient #* *##end #* *##if ($attribute.lobType) ## LOB type is specified - also sepcify FetchType if set to EAGER since default fetch type for LOB annotation is LAZY @javax.persistence.Lob(type = javax.persistence.LobType.${attribute.lobType}#if ($attribute.eager), fetch = javax.persistence.FetchType.EAGER#end) #* *##end @javax.persistence.Column(name = "${attribute.columnName}"#if ($attribute.unique), unique = ${attribute.unique}#end#if (!$attribute.columnNullable), nullable = ${attribute.columnNullable}#end#if ($attribute.columnLength), length = ${attribute.columnLength}#end#if ($attribute.columnDefinition), columnDefinition = "${attribute.columnDefinition}"#end#if ($attribute.columnPrecision), precision = ${attribute.columnPrecision}#end#if ($attribute.columnScale), scale = ${attribute.columnScale}#end) ## Only add the fetch type property for LAZY hints - default is EAGER #* *##if ($attribute.lazy) @javax.persistence.Basic(fetch = javax.persistence.FetchType.LAZY) #* *##end public $attribute.type.fullyQualifiedName ${attribute.getterName}() { return $attribute.name; } ## Allow only if not a version attribute since they are set by the container - No setter method is made available /** * Set the $attribute.name property. * @param value the new value */ #if (!$attribute.version) public#else protected#end void ${attribute.setterName}($attribute.type.fullyQualifiedName value) { this.${attribute.name} = value; } #**##end #end // ------------- Relations ------------------ #foreach ($associationEnd in $entity.allEntityRelations) #**##set ($target = $associationEnd.otherEnd) #**##if($target.navigable) #* *##if ($associationEnd.many2One) ## ## MANY TO ONE RELATIONSHIP ## ## Default fetch type: EAGER ## /** * Get the ${target.name} * @return $associationEnd.relationType */ #* *##set ($argExists = false) @javax.persistence.ManyToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) public $associationEnd.relationType ${target.getterName}() { return this.${target.name}; } #* *##if(!$target.readOnly) /** * Set the ${target.name} * @param ${target.name} */ public void ${target.setterName}($associationEnd.relationType ${target.name}) { this.${target.name} = ${target.name}; } #* *##end #* *##elseif ($associationEnd.one2Many) ## ## ONE TO MANY RELATIONSHIP ## ## Include the mappedBy element for bidirection relationships ONLY ## Default fetch type: LAZY ## If orderBy element is not specified, container assumes PK ordering ## /** * Get the ${target.name} Collection * @return $associationEnd.relationType */ #* *##set ($argExists = false) @javax.persistence.OneToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($associationEnd.navigable)#if ($argExists) ,#end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) #* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) #* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) @javax.persistence.OrderBy("${target.orderByClause}") #* *##else @javax.persistence.OrderBy #* *##end #* *##end public $associationEnd.relationType<${target.type.name}> ${target.getterName}() { return this.${target.name}; } /** * Set the ${target.name} * @param ${target.name} */ public void ${target.setterName} (${associationEnd.relationType}<${target.type.name}> ${target.name}) { this.${target.name} = ${target.name}; } #* *##elseif ($associationEnd.one2One) ## ## ONE TO ONE RELATIONSHIP ## ## Default fetch type: EAGER ## /** * Get the ${target.name} * @return $associationEnd.relationType */ #* *##set ($argExists = false) @javax.persistence.OneToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if(!$associationEnd.owning)#if ($argExists), #end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) #* *##if($associationEnd.owning) @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) #* *##end public $associationEnd.relationType ${target.getterName}() { return this.${target.name}; } #* *##if(!$target.readOnly) /** * Set the ${target.name} * @param ${target.name} */ public void ${target.setterName}($associationEnd.relationType ${target.name}) { this.${target.name} = ${target.name}; } #* *##end #* *##elseif ($associationEnd.many2Many) ## ## MANY TO MANY RELATIONSHIP ## ## Default fetch type: LAZY ## /** * Get the ${target.name} Collection * @return $associationEnd.relationType */ #* *##set ($argExists = false) @javax.persistence.ManyToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) ## Use Aggregation and Composition to determine owning side #* *##if(($associationEnd.owning) && ${associationEnd.association.tableName}) @javax.persistence.JoinTable(table = @javax.persistence.Table(name = "${associationEnd.association.tableName}")) #* *##end #* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) #* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) @javax.persistence.OrderBy("${target.orderByClause}") #* *##else @javax.persistence.OrderBy #* *##end #* *##end public $associationEnd.relationType<${target.type.name}> ${target.getterName}() { return this.${target.name}; } /** * Set the ${target.name} * @param ${target.name} */ public void ${target.setterName} (${associationEnd.relationType}<${target.type.name}> ${target.name}) { this.${target.name} = ${target.name}; } #* *##end #**##end #end #if ($entity.genericFinders) // ----------- Generic Finder Methods -------------- /** * Returns the collection of all ${entity.name}s. * * @param em javax.persistence.EntityManager * @return all available ${entity.name} objects */ public static java.util.Collection<${entity.name}> findAll(javax.persistence.EntityManager em) { return em.createQuery("FROM ${entity.tableName} AS $stringUtils.uncapitalize(${entity.name})").getResultList(); } #**##foreach ($attribute in $entity.attributes) #* *##if ($attribute.identifier) #* *##set ($identifierName = $attribute.name) #* *##set ($identifierType = $attribute.type.fullyQualifiedName) #* *##set ($identifierTypeWrapperName = $attribute.type.wrapperName) #* *##end #**##end /** * Returns the ${entity.name} matching the identifier. * * @param em javax.persistence.EntityManager * @param ${identifierName} the primary key * @return the ${entity.name} object matching the primary key */ public static ${entity.fullyQualifiedEntityName} findByPrimaryKey(javax.persistence.EntityManager em, ${identifierType} ${identifierName}) { ## Identifier will always be a primitive type return em.find(${entity.fullyQualifiedEntityName}.class, new ${identifierTypeWrapperName}(${identifierName})); } #end #set ($finders = $entity.getQueryOperations(true)) #if (!$finders.empty) // -------- User Defined Finder Methods ------------ #**##foreach ($finder in $finders) #* *##set ($returnType = $finder.returnType.fullyQualifiedName) #* *##set ($parameterList = $finder.typedArgumentList) #* *##if ($finder.arguments.empty) #* *##set ($parameters = "javax.persistence.EntityManager em") #* *##else #* *##set ($parameters = "javax.persistence.EntityManager em, ${parameterList}") #* *##end /** $finder.getDocumentation(" * ") * * Finder method for ${entity.name} entity using a query. * @param em javax.persistence.EntityManager #* *##foreach ($parameter in $finder.arguments) * @param $parameter.type.fullyQualifiedName ${parameter.name} #* *##end * @return $returnType */ $finder.visibility static $returnType#if ($returnType == "java.util.Collection" || $returnType == "java.util.List")<${entity.name}>#end ${finder.name}($parameters) { javax.persistence.Query query = em.createQuery("$finder.query"); #* *##foreach ($parameter in $finder.arguments) #* *##set ($index = $velocityCount - 1) #* *##if ($parameter.firstResult) query.setFirstResult(${parameter.name}); #* *##elseif ($parameter.maxResults) query.setMaxResults(${parameter.name}); #* *##else #* *##if ($finder.useNamedParameters) query.setParameter("${parameter.name}",#if ($parameter.type.primitive) new ${parameter.type.wrapperName}(${parameter.name})#else ${parameter.name}#end#if ($parameter.temporalType), javax.persistence.TemporalType.${parameter.temporalType}#end); #* *##else query.setParameter(${index},#if ($parameter.type.primitive) new ${parameter.type.wrapperName}(${parameter.name})#else ${parameter.name}#end#if ($parameter.temporalType), javax.persistence.TemporalType.${parameter.temporalType}#end); #* *##end #* *##end #* *##end #* *##if ($finder.returnType.primitive) return (($finder.returnType.wrapperName)query.getSingleResult()).${returnType}Value(); #* *##elseif (!$finder.returnType.collectionType) return ($returnType)query.getSingleResult(); #* *##else return query.getResultList(); #* *##end } #**##end #end #set ($businessOperations = $entity.businessOperations) #if (!$businessOperations.empty) // --------------- Business Methods ----------------- #**##foreach ($operation in ) #* *##set ($signature = $operation.signature) #* *##set ($visibility = $operation.visibility.toString()) /** $operation.getDocumentation(" * ") */ #* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##if ($operation.exceptionsPresent) $visibility abstract $returnType $signature throws $operation.exceptionList; #* *##else $visibility abstract $returnType $signature; #* *##end #**##end #end } |
From: Vance K. <va...@us...> - 2006-01-17 04:10:23
|
User: vancek Date: 06/01/16 20:10:17 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java Log: added interceptor and security run as stereotypes, removed security roles allowed tagged value, renamed security domain tagged value Revision Changes Path 1.4 +24 -13 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- EJB3Profile.java 6 Jan 2006 13:54:28 -0000 1.3 +++ EJB3Profile.java 17 Jan 2006 04:10:17 -0000 1.4 @@ -90,6 +90,17 @@ */ public static final String STEREOTYPE_DATA_SOURCE = profile.get("DATA_SOURCE"); + /** + * Represents an interceptor class for a session bean. + */ + public static final String STEREOTYPE_INTERCEPTOR = profile.get("INTERCEPTOR"); + + /** + * Represents a dependency from an actor that is identified to + * apply a run-as identity to the bean when making calls. + */ + public static final String STEREOTYPE_SECURITY_RUNAS = profile.get("SECURITY_RUN_AS"); + /* ----------------- Tagged Values -------------------- */ /** @@ -310,12 +321,6 @@ public static final String TAGGEDVALUE_EJB_SESSION_TYPE = profile.get("SERVICE_TYPE"); /** - * The tagged value representing the comma separated list of security roles - * permitted to execute operations in the bean. - */ - public static final String TAGGEDVALUE_EJB_SECURITY_ROLES_ALLOWED = profile.get("SECURITY_ROLES_ALLOWED"); - - /** * The tagged value representing whether to permit all roles to execute * operations in the bean. */ @@ -331,13 +336,7 @@ * The tagged value representing the security domain to sepecify at * the session bean class level. */ - public static final String TAGGEDVALUE_EJB_SECURITY_DOMAIN = profile.get("SECURITY_DOMAIN"); - - /** - * The tagged value representing the run-as identity the bean will - * use when making calls. - */ - public static final String TAGGEDVALUE_EJB_SECURITY_RUN_AS = profile.get("SECURITY_RUN_AS"); + public static final String TAGGEDVALUE_EJB_SECURITY_REALM = profile.get("SECURITY_REALM"); /** * The tagged value representing the JMS message driven bean @@ -368,4 +367,16 @@ * topic subscription durability mode. */ public static final String TAGGEDVALUE_EJB_MDB_DURABILITY = profile.get("MDB_SUBSCRIPTION_DURABILITY"); + + /** + * The tagged value representing the session bean remote interface + * JNDI name. + */ + public static final String TAGGEDVALUE_EJB_SESSION_JNDI_NAME_REMOTE = profile.get("SERVICE_JNDI_NAME_REMOTE"); + + /** + * The tagged value representing the session bean local interface + * JNDI name. + */ + public static final String TAGGEDVALUE_EJB_SESSION_JNDI_NAME_Local = profile.get("SERVICE_JNDI_NAME_LOCAL"); } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-17 04:08:51
|
User: vancek Date: 06/01/16 20:08:45 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Globals.java Log: changed SECURITY_DOMAIN to SECURITY_REALM Revision Changes Path 1.4 +1 -1 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- EJB3Globals.java 6 Jan 2006 13:54:28 -0000 1.3 +++ EJB3Globals.java 17 Jan 2006 04:08:45 -0000 1.4 @@ -210,7 +210,7 @@ /** * Represents the default security domain */ - public static final String SECURITY_DOMAIN = "securityDomain"; + public static final String SECURITY_REALM = "securityRealm"; /** * Represents the bean managed transaction demarcation |
From: Vance K. <va...@us...> - 2006-01-17 04:08:22
|
User: vancek Date: 06/01/16 20:08:12 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityFacadeLogicImpl.java Log: added entity generic finders support Revision Changes Path 1.4 +23 -5 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- EJB3EntityFacadeLogicImpl.java 6 Jan 2006 13:56:17 -0000 1.3 +++ EJB3EntityFacadeLogicImpl.java 17 Jan 2006 04:08:12 -0000 1.4 @@ -50,12 +50,14 @@ private static final String ENTITY_INHERITANCE_STRATEGY = "entityInheritanceStrategy"; /** - * Stores the default entity discriminator type used in the inheritance annotation + * Stores the default entity discriminator type used in the + * inheritance annotation */ private static final String ENTITY_DISCRIMINATOR_TYPE = "entityDiscriminatorType"; /** - * Stores the default entity discriminator column name used in the DiscriminatorColumn annotation + * Stores the default entity discriminator column name used in + * the DiscriminatorColumn annotation */ private static final String ENTITY_DISCRIMINATOR_COLUMN_NAME = "entityDiscriminatorColumnName"; @@ -119,20 +121,28 @@ public static final String ENTITY_NAME_PATTERN = "entityNamePattern"; /** - * The property which stores the pattern defining the entity implementation name. + * The property which stores the pattern defining the entity + * implementation name. */ public static final String ENTITY_IMPLEMENTATION_NAME_PATTERN = "entityImplementationNamePattern"; /** - * The property that stores the pattern defining the entity listener class name. + * The property that stores the pattern defining the entity + * listener class name. */ public static final String ENTITY_LISTENER_NAME_PATTERN = "entityListenerNamePattern"; /** - * The property that stores the pattern defining the entity embeddable super class name. + * The property that stores the pattern defining the entity + * embeddable super class name. */ public static final String ENTITY_EMBEDDABLE_NAME_PATTERN = "entityEmbeddableNamePattern"; + /** + * The p0roperty that stores the generic finders option + */ + private static final String ENTITY_GENERIC_FINDERS = "entityGenericFinders"; + // ---------------- constructor ------------------------------- public EJB3EntityFacadeLogicImpl (Object metaObject, String context) @@ -859,4 +869,12 @@ } return sb.toString(); } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacadeLogic#handleIsGenericFinders() + */ + protected boolean handleIsGenericFinders() + { + return BooleanUtils.toBoolean(String.valueOf(this.getConfiguredProperty(ENTITY_GENERIC_FINDERS))); + } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-17 04:07:22
|
User: vancek Date: 06/01/16 20:07:16 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3SessionOperationFacadeLogicImpl.java Log: changed getRolesAllowed to used actors for roles, added getNonRunAsRoles method Revision Changes Path 1.5 +77 -16 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionOperationFacadeLogicImpl.java Index: EJB3SessionOperationFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionOperationFacadeLogicImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- EJB3SessionOperationFacadeLogicImpl.java 10 Jan 2006 08:16:32 -0000 1.4 +++ EJB3SessionOperationFacadeLogicImpl.java 17 Jan 2006 04:07:16 -0000 1.5 @@ -1,7 +1,18 @@ package org.andromda.cartridges.ejb3.metafacades; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashSet; + import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; +import org.andromda.metafacades.uml.DependencyFacade; +import org.andromda.metafacades.uml.Role; +import org.andromda.metafacades.uml.Service; +import org.apache.commons.collections.Closure; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.Predicate; +import org.apache.commons.collections.Transformer; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; @@ -112,25 +123,23 @@ */ protected String handleGetRolesAllowed() { - String rolesAllowedStr = null; - final String tmpRoles = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_ROLES_ALLOWED); - if (StringUtils.isNotBlank(tmpRoles)) - { - StringBuffer rolesAllowed = new StringBuffer(); - final String[] roles = StringUtils.split(tmpRoles, ','); - for (int i = 0; i < roles.length; i++) + StringBuffer rolesAllowed = null; + String separator = ""; + + for (final Iterator iter = this.getNonRunAsRoles().iterator(); iter.hasNext(); ) { - if (i > 0) + if (rolesAllowed == null) { - rolesAllowed.append(", "); + rolesAllowed = new StringBuffer(); } + rolesAllowed.append(separator); + Role role = (Role)iter.next(); rolesAllowed.append('"'); - rolesAllowed.append(roles[i]); + rolesAllowed.append(role.getName()); rolesAllowed.append('"'); + separator = ", "; } - rolesAllowedStr = rolesAllowed.toString(); - } - return rolesAllowedStr; + return rolesAllowed != null ? rolesAllowed.toString() : null; } /** @@ -204,4 +213,56 @@ return throwsClause.toString(); } + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleGetNonRunAsRoles() + */ + protected Collection handleGetNonRunAsRoles() + { + final Collection roles = new LinkedHashSet(); + if (this.getOwner() instanceof EJB3SessionFacade) + { + roles.addAll(((EJB3SessionFacade)this.getOwner()).getNonRunAsRoles()); + } + Collection operationRoles = this.getTargetDependencies(); + CollectionUtils.filter( + operationRoles, + new Predicate() + { + public boolean evaluate(Object object) + { + DependencyFacade dependency = (DependencyFacade)object; + return dependency != null + && dependency.getSourceElement() != null + && Role.class.isAssignableFrom(dependency.getSourceElement().getClass()) + && !dependency.hasStereotype(EJB3Profile.STEREOTYPE_SECURITY_RUNAS); + } + }); + CollectionUtils.transform( + operationRoles, + new Transformer() + { + public Object transform(Object object) + { + return ((DependencyFacade)object).getSourceElement(); + } + }); + roles.addAll(operationRoles); + final Collection allRoles = new LinkedHashSet(roles); + + // add all roles which are specializations of this one + CollectionUtils.forAllDo( + roles, + new Closure() + { + public void execute(Object object) + { + if (object instanceof Role) + { + allRoles.addAll(((Role)object).getAllSpecializations()); + } + } + }); + return allRoles; + } + } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-17 04:06:28
|
User: vancek Date: 06/01/16 20:06:21 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3SessionFacadeLogicImpl.java Log: added getJNDINameRemote and getJNDINameLocal, removed getJNDIName and getJNDINamePrefix, added isViewTypeLocal and isViewTypeRemote, changed getRolesAllowed to used actors for roles, added getNonRunAsRoles, change getSecurityDomain to getSecurityRealm, changed getRunAs to use actors for roles, added getInterceptorReferences, added getInterceptorsAsList Revision Changes Path 1.5 +152 -46 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionFacadeLogicImpl.java Index: EJB3SessionFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionFacadeLogicImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- EJB3SessionFacadeLogicImpl.java 10 Jan 2006 08:15:32 -0000 1.4 +++ EJB3SessionFacadeLogicImpl.java 17 Jan 2006 04:06:20 -0000 1.5 @@ -3,14 +3,18 @@ import java.text.MessageFormat; import java.util.Collection; import java.util.Iterator; +import java.util.LinkedHashSet; import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; import org.andromda.cartridges.ejb3.metafacades.EJB3OperationFacade; import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.ModelElementFacade; +import org.andromda.metafacades.uml.Role; +import org.apache.commons.collections.Closure; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; +import org.apache.commons.collections.Transformer; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; @@ -111,35 +115,19 @@ } /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade#getJndiName() + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetJndiNameRemote() */ - protected java.lang.String handleGetJndiName() + protected String handleGetJndiNameRemote() { - StringBuffer jndiName = new StringBuffer(); - String jndiNamePrefix = StringUtils.trimToEmpty(this.getJndiNamePrefix()); - if (StringUtils.isNotEmpty(jndiNamePrefix)) - { - jndiName.append(jndiNamePrefix); - jndiName.append("/"); - } - jndiName.append("ejb/"); - jndiName.append(this.getFullyQualifiedName()); - return jndiName.toString(); + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_JNDI_NAME_REMOTE); } /** - * Gets the <code>jndiNamePrefix</code> for this EJB. - * - * @return the EJB Jndi name prefix. + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetJndiNameLocal() */ - protected String getJndiNamePrefix() + protected String handleGetJndiNameLocal() { - String prefix = null; - if (this.isConfiguredProperty(EJB3Globals.JNDI_NAME_PREFIX)) - { - prefix = (String)this.getConfiguredProperty(EJB3Globals.JNDI_NAME_PREFIX); - } - return prefix; + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_JNDI_NAME_Local); } /** @@ -205,6 +193,34 @@ } /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleIsViewTypeLocal() + */ + protected boolean handleIsViewTypeLocal() + { + boolean isLocal = false; + if (this.getViewType().equalsIgnoreCase(EJB3Globals.VIEW_TYPE_LOCAL) || + this.getViewType().equalsIgnoreCase(EJB3Globals.VIEW_TYPE_BOTH)) + { + isLocal = true; + } + return isLocal; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleIsViewTypeRemote() + */ + protected boolean handleIsViewTypeRemote() + { + boolean isRemote = false; + if (this.getViewType().equalsIgnoreCase(EJB3Globals.VIEW_TYPE_REMOTE) || + this.getViewType().equalsIgnoreCase(EJB3Globals.VIEW_TYPE_BOTH)) + { + isRemote = true; + } + return isRemote; + } + + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade#getHomeInterfaceName() */ protected java.lang.String handleGetHomeInterfaceName() @@ -512,25 +528,23 @@ */ protected String handleGetRolesAllowed() { - String rolesAllowedStr = null; - final String tmpRoles = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_ROLES_ALLOWED); - if (StringUtils.isNotBlank(tmpRoles)) - { - StringBuffer rolesAllowed = new StringBuffer(); - final String[] roles = StringUtils.split(tmpRoles, ','); - for (int i = 0; i < roles.length; i++) + StringBuffer rolesAllowed = null; + String separator = ""; + + for (final Iterator iter = this.getNonRunAsRoles().iterator(); iter.hasNext(); ) { - if (i > 0) + if (rolesAllowed == null) { - rolesAllowed.append(", "); + rolesAllowed = new StringBuffer(); } + rolesAllowed.append(separator); + Role role = (Role)iter.next(); rolesAllowed.append('"'); - rolesAllowed.append(roles[i]); + rolesAllowed.append(role.getName()); rolesAllowed.append('"'); + separator = ", "; } - rolesAllowedStr = rolesAllowed.toString(); - } - return rolesAllowedStr; + return rolesAllowed != null ? rolesAllowed.toString() : null; } /** @@ -562,17 +576,17 @@ } /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetSecurityDomain() + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetSecurityRealm() */ - protected String handleGetSecurityDomain() + protected String handleGetSecurityRealm() { - String securityDomain = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_DOMAIN); - if (StringUtils.isBlank(securityDomain)) + String securityRealm = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_REALM); + if (StringUtils.isBlank(securityRealm)) { - securityDomain = StringUtils.trimToEmpty( - ObjectUtils.toString(this.getConfiguredProperty(EJB3Globals.SECURITY_DOMAIN))); + securityRealm = StringUtils.trimToEmpty( + ObjectUtils.toString(this.getConfiguredProperty(EJB3Globals.SECURITY_REALM))); } - return securityDomain; + return securityRealm; } /** @@ -580,7 +594,26 @@ */ protected String handleGetRunAs() { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_RUN_AS); + String runAsRole = null; + DependencyFacade dependency = (DependencyFacade)CollectionUtils.find( + this.getTargetDependencies(), + new Predicate() + { + public boolean evaluate(final Object object) + { + DependencyFacade dependency = (DependencyFacade)object; + return dependency != null + && dependency.getSourceElement() != null + && dependency.getSourceElement() instanceof Role + && dependency.hasStereotype(EJB3Profile.STEREOTYPE_SECURITY_RUNAS); + } + }); + if (dependency != null) + { + Role role = (Role)dependency.getSourceElement(); + runAsRole = role.getName(); + } + return runAsRole; } /** @@ -661,4 +694,77 @@ return references; } + /*( + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetInterceptorReferences() + */ + protected Collection handleGetInterceptorReferences() + { + Collection references = super.getSourceDependencies(); + CollectionUtils.filter(references, new Predicate() + { + public boolean evaluate(Object object) + { + DependencyFacade dependency = (DependencyFacade)object; + ModelElementFacade targetElement = dependency.getTargetElement(); + return (targetElement != null && targetElement.hasStereotype(EJB3Profile.STEREOTYPE_INTERCEPTOR)); + } + }); + return references; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic# + * handleGetInterceptorsAsList(java.util.Collection) + */ + protected String handleGetInterceptorsAsList(Collection interceptors) + { + StringBuffer sb = new StringBuffer(); + String separator = ""; + + for (final Iterator it = interceptors.iterator(); it.hasNext();) + { + DependencyFacade dependency = (DependencyFacade)it.next(); + sb.append(separator); + separator = ", "; + sb.append(dependency.getTargetElement().getFullyQualifiedName() + ".class"); + } + return sb.toString(); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetNonRunAsRoles() + */ + protected Collection handleGetNonRunAsRoles() + { + Collection roles = this.getTargetDependencies(); + CollectionUtils.filter(roles, new Predicate() + { + public boolean evaluate(final Object object) + { + DependencyFacade dependency = (DependencyFacade)object; + return dependency != null + && dependency.getSourceElement() != null + && dependency.getSourceElement() instanceof Role + && !dependency.hasStereotype(EJB3Profile.STEREOTYPE_SECURITY_RUNAS); + } + }); + CollectionUtils.transform(roles, new Transformer() + { + public Object transform(final Object object) + { + return ((DependencyFacade)object).getSourceElement(); + } + }); + final Collection allRoles = new LinkedHashSet(roles); + // add all roles which are generalizations of this one + CollectionUtils.forAllDo(roles, new Closure() + { + public void execute(final Object object) + { + allRoles.addAll(((Role)object).getAllSpecializations()); + } + }); + return allRoles; + } + } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-17 03:54:02
|
User: vancek Date: 06/01/16 19:53:56 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3MessageDrivenFacadeLogicImpl.java Log: fixed handleGetRunAs to retrieve role from Actor dependency - inline with spring cartridge Revision Changes Path 1.2 +21 -1 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3MessageDrivenFacadeLogicImpl.java Index: EJB3MessageDrivenFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3MessageDrivenFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3MessageDrivenFacadeLogicImpl.java 6 Jan 2006 13:56:35 -0000 1.1 +++ EJB3MessageDrivenFacadeLogicImpl.java 17 Jan 2006 03:53:55 -0000 1.2 @@ -9,6 +9,7 @@ import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.ModelElementFacade; +import org.andromda.metafacades.uml.Role; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.apache.commons.lang.StringUtils; @@ -171,7 +172,26 @@ */ protected java.lang.String handleGetRunAs() { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_RUN_AS); + String runAsRole = null; + DependencyFacade dependency = (DependencyFacade)CollectionUtils.find( + this.getTargetDependencies(), + new Predicate() + { + public boolean evaluate(final Object object) + { + DependencyFacade dependency = (DependencyFacade)object; + return dependency != null + && dependency.getSourceElement() != null + && dependency.getSourceElement() instanceof Role + && dependency.hasStereotype(EJB3Profile.STEREOTYPE_SECURITY_RUNAS); + } + }); + if (dependency != null) + { + Role role = (Role)dependency.getSourceElement(); + runAsRole = role.getName(); + } + return runAsRole; } /** |
From: Vance K. <va...@us...> - 2006-01-17 03:51:16
|
User: vancek Date: 06/01/16 19:51:10 Added: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3InterceptorFacadeLogicImpl.java Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3InterceptorFacadeLogicImpl.java Index: EJB3InterceptorFacadeLogicImpl.java =================================================================== package org.andromda.cartridges.ejb3.metafacades; import java.text.MessageFormat; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacade. * * @see org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacade */ public class EJB3InterceptorFacadeLogicImpl extends EJB3InterceptorFacadeLogic { /** * The property which stores the pattern defining the interceptor class name. */ private static final String INTERCEPTOR_NAME_PATTERN = "interceptorNamePattern"; public EJB3InterceptorFacadeLogicImpl (Object metaObject, String context) { super (metaObject, context); } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacade#getInterceptorName() */ protected java.lang.String handleGetInterceptorName() { String interceptorNamePattern = (String)this.getConfiguredProperty(INTERCEPTOR_NAME_PATTERN); return MessageFormat.format( interceptorNamePattern, new Object[] {StringUtils.trimToEmpty(this.getName())}); } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacade#getFullyQualifiedInterceptorName() */ protected java.lang.String handleGetFullyQualifiedInterceptorName() { return EJB3MetafacadeUtils.getFullyQualifiedName( this.getPackageName(), this.getInterceptorName(), null); } } |
From: Vance K. <va...@us...> - 2006-01-17 03:50:23
|
User: vancek Date: 06/01/16 19:50:15 Modified: andromda-ejb3/src/main/uml EJB3MetafacadeModel.xml.zip Log: added EJB3InterceptorFacade and change EJB3SessionOperationFacade to extend ServiceOperation, added nonRunAsRoles association from EJB3SessionOperationFacade and EJB3SessionFacade to Role Revision Changes Path 1.4 +133 -100 cartridges/andromda-ejb3/src/main/uml/EJB3MetafacadeModel.xml.zip <<Binary file>> |
From: Vance K. <va...@us...> - 2006-01-17 03:27:13
|
User: vancek Date: 06/01/16 19:27:07 Modified: andromda-ejb3/src/main/resources/META-INF/andromda profile.xml Log: added INTERCEPTOR and SECURITY_RUN_AS stereotype elements, added SERVICE_JNDI_NAME_REMOTE and SERVICE_JNDI_NAME_LOCAL elements, removed SECURITY_ROLES_ALLOWED element, changed SECURITY_DOMAIN element to SECURITY_REALM Revision Changes Path 1.4 +54 -35 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- profile.xml 6 Jan 2006 13:53:27 -0000 1.3 +++ profile.xml 17 Jan 2006 03:27:07 -0000 1.4 @@ -152,6 +152,30 @@ class </appliedOnElement> </element> + <element name="INTERCEPTOR"> + <documentation> + Defines a customer made interceptor for the business + methods of the session bean and message driven + bean. + </documentation> + <value>Interceptor</value> + <appliedOnElement> + class + </appliedOnElement> + </element> + <element name="SECURITY_RUN_AS"> + <documentation> + Represents a dependency from an actor that is + identified to apply a run-as identity to the bean + when making calls. + It does not affect the identity of the + method callers. + </documentation> + <value>RunAs</value> + <appliedOnElement> + Dependency + </appliedOnElement> + </element> <element name="VALUE_REF"> <documentation> Used to generate an association between an entity @@ -320,12 +344,10 @@ optional. This value indicates the name of the column to be used for the discriminator. If not specified for the SINGLE_TABLE or JOINED inheritance - mapping strategies, then default to - <b>TYPE</b> - . + mapping strategies, then default to <b>TYPE</b>. </documentation> <value> - @andromda.persistence.discriminator.column + @andromda.persistence.discriminator.column.name </value> <appliedOnElement> <![CDATA[<<Entity>>]]> @@ -442,20 +464,30 @@ <value>NEVER</value> </allowedValues> </element> - <element name="SECURITY_ROLES_ALLOWED"> + <element name="SERVICE_JNDI_NAME_REMOTE"> <documentation> - Specifies the comma separated list of security - roles that are permitted to execute opertions. - This can be set on the session bean or on - individual operations. - If set on the session bean, all operations will - inherit this behaviour. + Used on a session bean to manually specify + the JNDI name the remote interface is bound + to. </documentation> <value> - @andromda.ejb.security.rolesAllowed + @andromda.ejb.service.jndi.remote </value> <appliedOnElement> - Service and service operation + <![CDATA[<<Service>>]]> + </appliedOnElement> + </element> + <element name="SERVICE_JNDI_NAME_LOCAL"> + <documentation> + Used on a session bean to manually specify + the JNDI name the local interface is bound + to. + </documentation> + <value> + @andromda.ejb.service.jndi.local + </value> + <appliedOnElement> + <![CDATA[<<Service>>]]> </appliedOnElement> </element> <element name="SECURITY_PERMIT_ALL"> @@ -504,27 +536,14 @@ <value>false</value> </allowedValues> </element> - <element name="SECURITY_RUN_AS"> - <documentation> - Specifies the run-as identity that the - bean will use when making calls. It does - not affect the identity of the method callers. - </documentation> - <value> - @andromda.ejb.security.runAs - </value> - <appliedOnElement> - Session bean - </appliedOnElement> - </element> - <element name="SECURITY_DOMAIN"> + <element name="SECURITY_REALM"> <documentation> Specifies the security domain for role based authorization. JBoss uses - the security model to match allowed roles. + the security realm to match allowed roles. </documentation> <value> - @andromda.ejb.security.domain + @andromda.ejb.security.realm </value> <appliedOnElement> Session bean |
From: Vance K. <va...@us...> - 2006-01-17 03:24:14
|
User: vancek Date: 06/01/16 19:24:09 Modified: andromda-ejb3/src/main/resources/META-INF/andromda namespace.xml Log: added session-config and interceptor outlet properties, hibernate JDBC and transaction properties, changed securityDomain property to securityRealm, added entityGenericFinders property Revision Changes Path 1.6 +107 -5 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.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- namespace.xml 10 Jan 2006 08:14:12 -0000 1.5 +++ namespace.xml 17 Jan 2006 03:24:09 -0000 1.6 @@ -53,6 +53,12 @@ files are generated. </documentation> </property> + <property name="session-config"> + <documentation> + The location where the ejb-jar.xml XML descriptor + is generated. + </documentation> + </property> <property name="message-driven-beans"> <documentation> The directory to which Message Driven Bean files @@ -65,6 +71,13 @@ implementation files are generated. </documentation> </property> + <property name="interceptor"> + <documentation> + The directory to which interceptor classes + for session beans or message driven beans + are generated. + </documentation> + </property> </propertyGroup> <propertyGroup name="JDBC"> <property name="entityManagerName" required="false"> @@ -100,7 +113,23 @@ The SQL dialect of the database. <ul> <li>org.hibernate.dialect.MySQLDialect</li> + <li>org.hibernate.dialect.MySQLInnoDBDialect</li> + <li>org.hibernate.dialect.MySQLMyISAMDialect</li> <li>org.hibernate.dialect.HSQLDialect</li> + <li>org.hibernate.dialect.PostgreSQLDialect</li> + <li>org.hibernate.dialect.DB2Dialect</li> + <li>org.hibernate.dialect.OracleDialect</li> + <li>org.hibernate.dialect.Oracle9Dialect</li> + <li>org.hibernate.dialect.SybaseDialect</li> + <li>org.hibernate.dialect.SQLServerDialect</li> + <li>org.hibernate.dialect.SAPDBDialect</li> + <li>org.hibernate.dialect.InformixDialect</li> + <li>org.hibernate.dialect.IngresDialect</li> + <li>org.hibernate.dialect.ProgressDialect</li> + <li>org.hibernate.dialect.InterbaseDialect</li> + <li>org.hibernate.dialect.PointbaseDialect</li> + <li>org.hibernate.dialect.FrontbaseDialect</li> + <li>org.hibernate.dialect.FirebirdDialect</li> </ul> </documentation> </property> @@ -109,6 +138,34 @@ Whether or not to log SQL statements. </documentation> </property> + <property name="hibernateMaxFetchDepth" required="false"> + <documentation> + Sets a maximum "depth" for the outer join fetch tree. Recommended values between 0 and 3 + </documentation> + </property> + <property name="hibernateJdbcFetchSize" required="false"> + <documentation> + A non-zero value determines the JDBC fetch size + </documentation> + </property> + <property name="hibernateJdbcBatchSize" required="false"> + <documentation> + A nonzero value enables use of JDBC2 batch updates by Hibernate. + Recommended values between 5 and 30 + </documentation> + </property> + <property name="hibernateJdbcUseScrollableResultSet" required="false"> + <documentation> + Whether or not to enable use of JDBC2 scrollable resultsets by Hibernate. + This property is only necessary when using user supplied connections. + Hibernate uses connection metadata otherwise. + </documentation> + </property> + <property name="hibernateJdbcUseStreamsForBinary" required="false"> + <documentation> + Whether or not to use streams when writing / reading binary or serializable types to/from JDBC. + </documentation> + </property> </propertyGroup> <propertyGroup name="Cache"> <property name="hibernateCacheProvider" required="false"> @@ -131,6 +188,32 @@ </documentation> </property> </propertyGroup> + <propertyGroup name="Transactions"> + <property name="hibernateTransactionFlushBeforeCompletion" required="false"> + <documentation> + Define if the session will automatically be flushed + during the before completion phase of the + transaction. Handy options for CMT demarcation. + Possible values are: + <ul> + <li>true</li> + <li>false</li> + </ul> + </documentation> + </property> + <property name="hibernateTransactionAutoCloseSession" required="false"> + <documentation> + Define if the session will be automatically closed + during the after completion phase of the transaction. + Handy option when using CMT demarcation. + Possible values are: + <ul> + <li>true</li> + <li>false</li> + </ul> + </documentation> + </property> + </propertyGroup> <propertyGroup name="Name Patterns"> <property name="entityNamePattern"> <default>{0}</default> @@ -233,6 +316,13 @@ bean implementation class name. </documentation> </property> + <property name="interceptorNamePattern"> + <default>{0}</default> + <documentation> + The pattern to use when constructing the interceptor + class name. + </documentation> + </property> <property name="jndiNamePrefix" required="false"> <documentation> The prefix to give to the EJB JNDI names (this @@ -326,8 +416,7 @@ </ul> </documentation> </property> - <property name="entityAggergationCascade" - required="false"> + <property name="entityAggergationCascade" required="false"> <documentation> Indicates how a UML aggreation should be interpreted to determine cascadable operations that are @@ -427,12 +516,12 @@ always exist. </documentation> </property> - <property name="securityDomain"> - <default>Default</default> + <property name="securityRealm" required="false"> <documentation> - Specifies the default security domain to use + Specifies the security domain to use for role based authorization. Use the security realm to match allowed roles. + This is only applicable for session beans. </documentation> </property> <property name="queryUseNamedParameters"> @@ -446,6 +535,19 @@ Does not apply to queries written in OCL. </documentation> </property> + <property name="entityGenericFinders"> + <default>true</default> + <documentation> + Specifies whether to include the generic finder + property. Generic finders in the entity bean include + findByPrimaryKey and findAll. + Permitted values are: + <ul> + <li>true</li> + <li>false</li> + </ul> + </documentation> + </property> <property name="valueObjectPackage"> <default>{0}</default> </property> |
From: Vance K. <va...@us...> - 2006-01-17 03:21:31
|
User: vancek Date: 06/01/16 19:21:24 Modified: andromda-ejb3/src/main/resources/META-INF/andromda metafacades.xml Log: added interceptor metafacade, changed securityDomain property to securityRealm, added entityGenericFinders property. Revision Changes Path 1.5 +9 -1 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- metafacades.xml 10 Jan 2006 08:14:12 -0000 1.4 +++ metafacades.xml 17 Jan 2006 03:21:22 -0000 1.5 @@ -12,8 +12,9 @@ <property reference="entityDiscriminatorType" /> <property reference="entityDiscriminatorColumnName" /> <property reference="serviceViewType" /> + <property reference="entityGenericFinders" /> <property reference="persistenceContainerName" /> - <property reference="securityDomain" /> + <property reference="securityRealm" /> <!-- Entity EJB Metafacades --> <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3OperationFacadeLogicImpl"> <mapping> @@ -117,4 +118,11 @@ <property reference="messageDrivenListenerNamePattern" /> <property reference="messageDrivenDestinationType" /> </metafacade> + <!-- Interceptor Metafacades --> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacadeLogicImpl" contextRoot="true"> + <mapping> + <stereotype>INTERCEPTOR</stereotype> + </mapping> + <property reference="interceptorNamePattern" /> + </metafacade> </metafacades> \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-17 03:20:20
|
User: vancek Date: 06/01/16 19:20:14 Modified: andromda-ejb3/src/main/resources/META-INF/andromda cartridge.xml Log: added interceptor templates, changed outputPattern value to use generatedFile variable for most templates, added condition for session bean local and remote interface generation, renamed Entity.vsl to EntityEmbeddable.vsl, renamed EntityImpl.vsl to Entity.vsl. Revision Changes Path 1.6 +72 -18 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- cartridge.xml 10 Jan 2006 08:12:20 -0000 1.5 +++ cartridge.xml 17 Jan 2006 03:20:14 -0000 1.6 @@ -2,6 +2,7 @@ <!-- define the template objects that are made availble to the template --> <templateObject name="stringUtils" className="org.apache.commons.lang.StringUtils"/> + <templateObject name="collectionUtils" className="org.apache.commons.collections.CollectionUtils"/> <templateObject name="transform" className="org.andromda.cartridges.ejb3.EJB3ScriptHelper"/> <!-- cartridge-templateObject merge-point--> @@ -22,8 +23,8 @@ <!-- Entity Bean Templates --> <template - path="templates/ejb3/Entity.vsl" - outputPattern="{0}/{1}.java" + path="templates/ejb3/EntityEmbeddable.vsl" + outputPattern="$generatedFile" outlet="entity-beans" overwrite="true"> <modelElements variable="entity"> @@ -33,21 +34,27 @@ </modelElements> </template> + <!-- + Do not generated the entity implementation class if marked + to be an embeddable super class + --> <template - path="templates/ejb3/EntityImpl.vsl" - outputPattern="{0}/{1}Impl.java" + path="templates/ejb3/Entity.vsl" + outputPattern="$generatedFile" outlet="entity-impls" overwrite="false"> <modelElements variable="entity"> <modelElement> - <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade"/> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade"> + <property name="embeddableSuperclass">false</property> + </type> </modelElement> </modelElements> </template> <template path="templates/ejb3/EntityListener.vsl" - outputPattern="{0}/{1}Listener.java" + outputPattern="$generatedFile" outlet="entity-impls" overwrite="false"> <modelElements variable="entity"> @@ -66,8 +73,7 @@ outputOnEmptyElements="false"> <modelElements variable="entities"> <modelElement> - <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade"> - </type> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade"/> </modelElement> </modelElements> </template> @@ -76,7 +82,7 @@ <template path="templates/ejb3/SessionBean.vsl" - outputPattern="{0}/{1}Bean.java" + outputPattern="$generatedFile" outlet="session-beans" overwrite="true"> <modelElements variable="service"> @@ -88,33 +94,37 @@ <template path="templates/ejb3/SessionLocal.vsl" - outputPattern="{0}/{1}Local.java" + outputPattern="$generatedFile" outlet="session-beans" overwrite="true" generateEmptyFiles="true"> <modelElements variable="service"> <modelElement> - <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"/> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"> + <property name="viewTypeLocal">true</property> + </type> </modelElement> </modelElements> </template> <template path="templates/ejb3/SessionRemote.vsl" - outputPattern="{0}/{1}Remote.java" + outputPattern="$generatedFile" outlet="session-beans" overwrite="true" generateEmptyFiles="true"> <modelElements variable="service"> <modelElement> - <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"/> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"> + <property name="viewTypeRemote">true</property> + </type> </modelElement> </modelElements> </template> <template path="templates/ejb3/SessionBeanImpl.vsl" - outputPattern="{0}/{1}BeanImpl.java" + outputPattern="$generatedFile" outlet="session-impls" overwrite="false"> <modelElements variable="service"> @@ -126,7 +136,7 @@ <template path="templates/ejb3/SessionListener.vsl" - outputPattern="{0}/{1}Listener.java" + outputPattern="$generatedFile" outlet="session-impls" overwrite="false"> <modelElements variable="service"> @@ -162,11 +172,41 @@ </modelElements> </template> + <!-- + <template + path="templates/ejb3/ejb-jar.xml.vsl" + outputPattern="META-INF/ejb-jar.xml" + outlet="session-config" + overwrite="true" + outputToSingleFile="true" + outputOnEmptyElements="false"> + <modelElements variable="services"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"/> + </modelElement> + </modelElements> + </template> + + <template + path="templates/ejb3/jboss.xml.vsl" + outputPattern="META-INF/jboss.xml" + outlet="session-config" + overwrite="true" + outputToSingleFile="true" + outputOnEmptyElements="false"> + <modelElements variable="services"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"/> + </modelElement> + </modelElements> + </template> + --> + <!-- Message Driven Bean Templates --> <template path="templates/ejb3/MessageDrivenBean.vsl" - outputPattern="{0}/{1}MDBBean.java" + outputPattern="$generatedFile" outlet="message-driven-beans" overwrite="true"> <modelElements variable="mdb"> @@ -178,7 +218,7 @@ <template path="templates/ejb3/MessageDrivenBeanImpl.vsl" - outputPattern="{0}/{1}MDBBeanImpl.java" + outputPattern="$generatedFile" outlet="message-driven-impls" overwrite="false"> <modelElements variable="mdb"> @@ -190,7 +230,7 @@ <template path="templates/ejb3/MessageDrivenListener.vsl" - outputPattern="{0}/{1}Listener.java" + outputPattern="$generatedFile" outlet="message-driven-impls" overwrite="false"> <modelElements variable="mdb"> @@ -200,6 +240,20 @@ </modelElements> </template> + <!-- Common Templates --> + + <template + path="templates/ejb3/Interceptor.vsl" + outputPattern="$generatedFile" + outlet="interceptor" + overwrite="false"> + <modelElements variable="interceptor"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacade"/> + </modelElement> + </modelElements> + </template> + <!-- cartridge-template merge-point --> </cartridge> \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-17 03:16:21
|
User: vancek Date: 06/01/16 19:16:13 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionRemote.vsl Log: added generatedFile variable for use in cartridge.xml, moved Remote annotation to session bean Revision Changes Path 1.3 +1 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionRemote.vsl Index: SessionRemote.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionRemote.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- SessionRemote.vsl 3 Jan 2006 01:06:24 -0000 1.2 +++ SessionRemote.vsl 17 Jan 2006 03:16:13 -0000 1.3 @@ -3,12 +3,12 @@ #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; #end +#set ($generatedFile = "${stringUtils.replace($service.fullyQualifiedServiceRemoteInterfaceName,'.','/')}.java") /** * Remote component interface for the ${service.serviceName} session bean. $service.getDocumentation(" * ") */ -...@ja...mote public interface ${service.serviceRemoteInterfaceName} #if ($service.generalization) extends ${service.generalization.fullyQualifiedName}Remote |