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-03-02 10:32:40
|
User: vancek Date: 06/03/02 02:32:38 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3SessionOperationFacadeLogicImpl.java Log: implemented the lifecycle callback method checks Revision Changes Path 1.9 +40 -0 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.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- EJB3SessionOperationFacadeLogicImpl.java 6 Feb 2006 04:08:19 -0000 1.8 +++ EJB3SessionOperationFacadeLogicImpl.java 2 Mar 2006 10:32:36 -0000 1.9 @@ -377,4 +377,44 @@ } return excludeClass; } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsPostConstruct() + */ + protected boolean handleIsPostConstruct() + { + return this.hasStereotype(EJB3Profile.STEREOTYPE_POST_CONSTRUCT); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsPreDestroy() + */ + protected boolean handleIsPreDestroy() + { + return this.hasStereotype(EJB3Profile.STEREOTYPE_PRE_DESTROY); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsPostActivate() + */ + protected boolean handleIsPostActivate() + { + return this.hasStereotype(EJB3Profile.STEREOTYPE_POST_ACTIVATE); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsPrePassivate() + */ + protected boolean handleIsPrePassivate() + { + return this.hasStereotype(EJB3Profile.STEREOTYPE_PRE_PASSIVATE); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsLifecycleCallback() + */ + protected boolean handleIsLifecycleCallback() + { + return this.isPostConstruct() || this.isPreDestroy() || this.isPostActivate() || this.isPrePassivate(); + } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-03-02 10:31:32
|
User: vancek Date: 06/03/02 02:31:30 Added: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3MessageDrivenOperationFacadeLogicImpl.java Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3MessageDrivenOperationFacadeLogicImpl.java Index: EJB3MessageDrivenOperationFacadeLogicImpl.java =================================================================== package org.andromda.cartridges.ejb3.metafacades; import org.andromda.cartridges.ejb3.EJB3Profile; /** * MetafacadeLogic implementation for org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenOperationFacade. * * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenOperationFacade */ public class EJB3MessageDrivenOperationFacadeLogicImpl extends EJB3MessageDrivenOperationFacadeLogic { public EJB3MessageDrivenOperationFacadeLogicImpl (Object metaObject, String context) { super (metaObject, context); } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenOperationFacade#isPostConstruct() */ protected boolean handleIsPostConstruct() { return this.hasStereotype(EJB3Profile.STEREOTYPE_POST_CONSTRUCT); } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenOperationFacade#isPreDestroy() */ protected boolean handleIsPreDestroy() { return this.hasStereotype(EJB3Profile.STEREOTYPE_PRE_DESTROY); } } |
From: Vance K. <va...@us...> - 2006-03-02 10:31:29
|
User: vancek Date: 06/03/02 02:30:56 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java Log: declare stereotypes for lifecycle methods Revision Changes Path 1.15 +23 -3 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.14 retrieving revision 1.15 diff -u -w -r1.14 -r1.15 --- EJB3Profile.java 25 Feb 2006 14:47:02 -0000 1.14 +++ EJB3Profile.java 2 Mar 2006 10:30:49 -0000 1.15 @@ -122,17 +122,37 @@ public static final String STEREOTYPE_LOB = profile.get("LOB"); /** - * The tagged value indicating the finder method parameter result type + * The stereotype indicating the finder method parameter result type * is assigned to be the first/index. */ public static final String STEREOTYPE_FINDER_RESULT_TYPE_FIRST = profile.get("RESULT_TYPE_FIRST"); /** - * The tagged value indicating the finder method parameter result type + * The stereotype indicating the finder method parameter result type * is assigned to be the max results to return. */ public static final String STEREOTYPE_FINDER_RESULT_TYPE_MAX = profile.get("RESULT_TYPE_MAX"); + /** + * Specifies the operation as a post-construct callback + */ + public static final String STEREOTYPE_POST_CONSTRUCT = profile.get("POST_CONSTRUCT"); + + /** + * Specifies the operation as a pre-destroy callback + */ + public static final String STEREOTYPE_PRE_DESTROY = profile.get("PRE_DESTROY"); + + /** + * Specifies the operation as a post-activate callback + */ + public static final String STEREOTYPE_POST_ACTIVATE = profile.get("POST_ACTIVATE"); + + /** + * Specifies the operation as a pre-passivate callback + */ + public static final String STEREOTYPE_PRE_PASSIVATE = profile.get("PRE_PASSIVATE"); + /* ----------------- Tagged Values -------------------- */ /** |
From: Vance K. <va...@us...> - 2006-03-02 10:28:37
|
User: vancek Date: 06/03/02 02:28:36 Modified: andromda-ejb3/src/main/resources/META-INF/andromda profile.xml Log: defined POST_CONSTRUCT, PRE_DESTROY, POST_ACTIVATE_PRE_PASSIVATE stereotype type elements Revision Changes Path 1.19 +48 -0 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/profile.xml Index: profile.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/profile.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- profile.xml 25 Feb 2006 14:45:51 -0000 1.18 +++ profile.xml 2 Mar 2006 10:28:35 -0000 1.19 @@ -266,6 +266,54 @@ Entity Finder Method Parameter </appliedOnElement> </element> + <element name="POST_CONSTRUCT"> + <documentation> + Specifies that the associated operation is a lifecycle + callback handler and will be invoked when the bean is + first created, after any dependency injection is required. + </documentation> + <value>PostConstruct</value> + <appliedOnElement> + Session and Message-Driven Bean Operation + </appliedOnElement> + </element> + <element name="PRE_DESTROY"> + <documentation> + Specifies that the associated operation is a lifecycle + callback handler and will be invoked when the bean is + removed from the pool or destroyed. For stateful session + beans, this occurs before the @Remove annotated method + is invoked. + </documentation> + <value>PreDestroy</value> + <appliedOnElement> + Session and Message-Driven Bean Operation + </appliedOnElement> + </element> + <element name="POST_ACTIVATE"> + <documentation> + Specifies that the associated operation is a lifecycle + callback handler for a stateful session bean and will + be invoked when the bean instance has just been + reactivated. + </documentation> + <value>PostActivate</value> + <appliedOnElement> + Stateful Session Bean Operation + </appliedOnElement> + </element> + <element name="PRE_PASSIVATE"> + <documentation> + Specifies that the associated operation is a lifecycle + callback handler for a stateful session bean and will + be invoked when container is ready to passivate + the instance. + </documentation> + <value>PrePassivate</value> + <appliedOnElement> + Stateful Session Bean Operation + </appliedOnElement> + </element> </elementGroup> <elementGroup name="Tagged Values"> <element name="ATTRIBUTE_PERSISTENCE_OPTIONAL"> |
From: Vance K. <va...@us...> - 2006-03-02 10:27:32
|
User: vancek Date: 06/03/02 02:27:30 Modified: andromda-ejb3/src/main/resources/META-INF/andromda metafacades.xml Log: added EJB3MessageDrivenOperationFacadeLogicImpl metafacade definition Revision Changes Path 1.15 +7 -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.14 retrieving revision 1.15 diff -u -w -r1.14 -r1.15 --- metafacades.xml 20 Feb 2006 05:15:11 -0000 1.14 +++ metafacades.xml 2 Mar 2006 10:27:30 -0000 1.15 @@ -152,6 +152,13 @@ <property reference="messageDrivenListenerNamePattern"/> <property reference="messageDrivenDestinationType"/> </metafacade> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenOperationFacadeLogicImpl"> + <mapping> + <context> + org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacade + </context> + </mapping> + </metafacade> <!-- Common Metafacades --> <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacadeLogicImpl" contextRoot="true"> <mapping> |
From: Vance K. <va...@us...> - 2006-03-02 10:26:11
|
User: vancek Date: 06/03/02 02:26:10 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionListener.vsl Log: the postActivate and prePassivate callback operations are only specified on stateful session beans. lifecycle callback operations invoke context.proceed() to continue the chain of interceptors. Revision Changes Path 1.4 +58 -23 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionListener.vsl Index: SessionListener.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionListener.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- SessionListener.vsl 6 Feb 2006 03:24:19 -0000 1.3 +++ SessionListener.vsl 2 Mar 2006 10:26:09 -0000 1.4 @@ -16,29 +16,64 @@ */ public ${service.serviceListenerName}() { + // empty constructor } @javax.ejb.PostConstruct public void postConstruct(javax.ejb.InvocationContext ctx) { + try + { // post construct implementation + ctx.proceed(); + } + catch (Exception ex) + { + throw new RuntimeException(e); + } + } + + @javax.ejb.PreDestroy + public void preDestroy(javax.ejb.InvocationContext ctx) + { + try + { + // pre destroy implementation + ctx.proceed(); + } + catch (Exception ex) + { + throw new RuntimeException(e); + } } +#if ($service.stateful) @javax.ejb.PostActivate public void postActivate(javax.ejb.InvocationContext ctx) { + try + { // post construct implementation + ctx.proceed(); + } + catch (Exception ex) + { + throw new RuntimeException(e); + } } @javax.ejb.PrePassivate public void prePassivate(javax.ejb.InvocationContext ctx) { + try + { // pre passivate implementation + ctx.proceed(); } - - @javax.ejb.PreDestroy - public void preDestroy(javax.ejb.InvocationContext ctx) + catch (Exception ex) { - // pre destroy implementation + throw new RuntimeException(e); + } } +#end } |
From: Vance K. <va...@us...> - 2006-03-02 10:24:41
|
User: vancek Date: 06/03/02 02:24:35 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionBean.vsl Log: add the lifecycle callback annotations for callback methods. if a lifecycle callback method, do not include other annotations on the operation. Revision Changes Path 1.19 +39 -20 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBean.vsl Index: SessionBean.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBean.vsl,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- SessionBean.vsl 23 Feb 2006 06:26:35 -0000 1.18 +++ SessionBean.vsl 2 Mar 2006 10:24:34 -0000 1.19 @@ -278,6 +278,24 @@ /** $operation.getDocumentation(" * ") */ +## +## If this operation is a lifecycle callback, then exclude all other +## annotations except the callback annotations +## +#* *##if ($operation.lifecycleCallback) +#* *##if ($operation.postConstruct) + @javax.ejb.PostConstruct +#* *##elseif ($operation.preDestroy) + @javax.ejb.PreDestroy +#* *##end +#* *##if ($service.stateful) +#* *##if ($operation.postActivate) + @javax.ejb.PostActivate +#* *##elseif ($operation.prePassivate) + @javax.ejb.PrePassivate +#* *##end +#* *##end +#* *##else #* *##if (!$service.transactionManagementBean) #* *##if ($operation.transactionType) @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${operation.transactionType}) @@ -310,6 +328,7 @@ #* *##if ($operation.excludeClassInterceptors) @javax.ejb.ExcludeClassInterceptors #* *##end +#* *##end $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #* *##if ($operation.exceptionsPresent) $operation.throwsClause |
From: Vance K. <va...@us...> - 2006-03-02 10:21:09
|
User: vancek Date: 06/03/02 02:21:03 Modified: andromda-ejb3/src/main/resources/templates/ejb3 EntityListener.vsl Log: added comment to constructor Revision Changes Path 1.3 +2 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityListener.vsl Index: EntityListener.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityListener.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- EntityListener.vsl 17 Jan 2006 03:06:43 -0000 1.2 +++ EntityListener.vsl 2 Mar 2006 10:21:02 -0000 1.3 @@ -16,6 +16,7 @@ */ public ${entity.entityListenerName}() { + // empty constructor } @javax.persistence.PrePersist |
From: Vance K. <va...@us...> - 2006-03-02 10:19:47
|
User: vancek Date: 06/03/02 02:19:45 Modified: andromda-ejb3/src/main/resources/templates/ejb3 ServiceDelegate.vsl Log: do not include operations that are session bean lifecycle callback methods Revision Changes Path 1.4 +16 -11 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/ServiceDelegate.vsl Index: ServiceDelegate.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/ServiceDelegate.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- ServiceDelegate.vsl 9 Feb 2006 07:09:45 -0000 1.3 +++ ServiceDelegate.vsl 2 Mar 2006 10:19:45 -0000 1.4 @@ -57,6 +57,10 @@ #end #foreach ($operation in $service.businessOperations) +## +## Do not include lifecycle callback methods +## +#**##if (!$operation.lifecycleCallback) /** * @see ${service.fullyQualifiedServiceName}#${operation.getSignature(false)} * @@ -94,6 +98,7 @@ } } +#**##end #end /** * Close down service delegate resources |
From: Vance K. <va...@us...> - 2006-03-02 10:18:51
|
User: vancek Date: 06/03/02 02:18:21 Modified: andromda-ejb3/src/main/resources/templates/ejb3 MessageDrivenListener.vsl Log: lifecycle methods can only have 1 arg of type InvocationContext call context.proceed() to continue the chain of interceptors after implementation Revision Changes Path 1.3 +22 -5 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenListener.vsl Index: MessageDrivenListener.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenListener.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- MessageDrivenListener.vsl 17 Jan 2006 03:08:17 -0000 1.2 +++ MessageDrivenListener.vsl 2 Mar 2006 10:18:15 -0000 1.3 @@ -16,17 +16,34 @@ */ public ${mdb.messageDrivenListenerName}() { + // empty constructor } @javax.ejb.PostConstruct - public void postConstruct(${mdb.fullyQualifiedMessageDrivenName} ${stringUtils.uncapitalize(${mdb.name})}) + public void postConstruct(javax.ejb.InvocationContext ctx) + { + try { // post construct implementation + ctx.proceed(); + } + catch (Exception ex) + { + throw new RuntimeException(e); + } } @javax.ejb.PreDestroy - public void preDestroy(${mdb.fullyQualifiedMessageDrivenName} ${stringUtils.uncapitalize(${mdb.name})}) + public void preDestroy(javax.ejb.InvocationContext ctx) + { + try { // pre destroy implementation + ctx.proceed(); + } + catch (Exception ex) + { + throw new RuntimeException(e); + } } } |
From: Vance K. <va...@us...> - 2006-03-02 10:15:46
|
User: vancek Date: 06/03/02 02:15:44 Modified: andromda-ejb3/src/main/resources/templates/ejb3 MessageDrivenBean.vsl Log: define all operations, regardless of visibility add the @PreDestroy and @PostConstruct on operations with corresponding stereotypes Revision Changes Path 1.10 +9 -6 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBean.vsl Index: MessageDrivenBean.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBean.vsl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -r1.9 -r1.10 --- MessageDrivenBean.vsl 25 Feb 2006 14:43:41 -0000 1.9 +++ MessageDrivenBean.vsl 2 Mar 2006 10:15:42 -0000 1.10 @@ -117,10 +117,14 @@ #**##foreach ($operation in $operations) #* *##set ($visibility = $operation.visibility) -#* *##if ($visibility == "public") /** $operation.getDocumentation(" * ") */ +#* *##if ($operation.postConstruct) + @javax.ejb.PostConstruct +#* *##elseif ($operation.preDestroy) + @javax.ejb.PreDestroy +#* *##end #* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##if ($operation.exceptionsPresent) $visibility abstract $returnType $operation.signature throws $operation.exceptionList; @@ -129,6 +133,5 @@ #* *##end #* *##end -#**##end #end } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-02-28 02:17:21
|
User: vancek Date: 06/02/27 18:17:20 Modified: andromda-ejb3/src/main/resources/META-INF/andromda namespace.xml Log: changed hibernate Hbm2DDLAuto default to update added hibernateTransactionManagerLookupClass property to Transaction property group Revision Changes Path 1.17 +16 -3 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.16 retrieving revision 1.17 diff -u -w -r1.16 -r1.17 --- namespace.xml 22 Feb 2006 06:15:30 -0000 1.16 +++ namespace.xml 28 Feb 2006 02:17:20 -0000 1.17 @@ -101,7 +101,7 @@ </documentation> </property> <property name="hibernateHbm2DDLAuto" required="false"> - <default>create</default> + <default>update</default> <documentation> Automatically export schema DDL to the database when deployed. With create-drop, the database schema will be dropped when @@ -147,7 +147,8 @@ </property> <property name="hibernateMaxFetchDepth" required="false"> <documentation> - Sets a maximum "depth" for the outer join fetch tree. Recommended values between 0 and 3 + Sets a maximum "depth" for the outer join fetch tree. + Recommended values between 0 and 3 </documentation> </property> <property name="hibernateJdbcFetchSize" required="false"> @@ -170,7 +171,8 @@ </property> <property name="hibernateJdbcUseStreamsForBinary" required="false"> <documentation> - Whether or not to use streams when writing / reading binary or serializable types to/from JDBC. + Whether or not to use streams when writing / reading binary + or serializable types to/from JDBC. </documentation> </property> </propertyGroup> @@ -196,6 +198,17 @@ </property> </propertyGroup> <propertyGroup name="Transactions"> + <property name="hibernateTransactionManagerLookupClass" required="false"> + <documentation> + Defines the classname of a TransactionManagerLookup + which is required when JVM-level caching is enabled + or when using hilo generator in a JTA environment. + Typicallyl, this value is: + <ul> + <li>org.hibernate.transaction.JBossTransactionManagerLookup</li> + </ul> + </documentation> + </property> <property name="hibernateTransactionFlushBeforeCompletion" required="false"> <documentation> Define if the session will automatically be flushed |
From: Vance K. <va...@us...> - 2006-02-28 02:15:46
|
User: vancek Date: 06/02/27 18:15:45 Modified: andromda-ejb3/src/main/resources/META-INF/andromda cartridge.xml Log: added hibernate property references Revision Changes Path 1.16 +8 -0 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.15 retrieving revision 1.16 diff -u -w -r1.15 -r1.16 --- cartridge.xml 23 Feb 2006 06:27:07 -0000 1.15 +++ cartridge.xml 28 Feb 2006 02:15:45 -0000 1.16 @@ -15,8 +15,16 @@ <property reference="hibernateHbm2DDLAuto"/> <property reference="hibernateDialect"/> <property reference="hibernateShowSql"/> + <property reference="hibernateMaxFetchDepth"/> + <property reference="hibernateJdbcFetchSize"/> + <property reference="hibernateJdbcBatchSize"/> + <property reference="hibernateJdbcUseScrollableResultSet"/> + <property reference="hibernateJdbcUseStreamsForBinary"/> <property reference="hibernateCacheProvider"/> <property reference="hibernateTreecacheMbeanObject"/> + <property reference="hibernateTransactionManagerLookupClass"/> + <property reference="hibernateTransactionFlushBeforeCompletion"/> + <property reference="hibernateTransactionAutoCloseSession"/> <property reference="serviceLocatorName"/> <property reference="manageableServiceLocatorName"/> <property reference="ejb3TypesPackage"/> |
From: Vance K. <va...@us...> - 2006-02-28 02:15:16
|
User: vancek Date: 06/02/27 18:14:53 Modified: andromda-ejb3/src/main/resources/templates/ejb3 persistence.xml.vsl Log: added hibernate transaction manager lookup class property Revision Changes Path 1.4 +3 -0 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/persistence.xml.vsl Index: persistence.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/persistence.xml.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- persistence.xml.vsl 6 Feb 2006 03:05:17 -0000 1.3 +++ persistence.xml.vsl 28 Feb 2006 02:14:53 -0000 1.4 @@ -39,6 +39,9 @@ #if ($stringUtils.isNotBlank($hibernateTreecacheMbeanObject)) <property name="hibernate.treecache.mbean.object_name" value="${hibernateTreecacheMbeanObject}"/> #end +#if ($stringUtils.isNotBlank($hibernateTransactionManagerLookupClass)) + <property name="hibernate.transaction.manager_lookup_class" value="${hibernateTransactionManagerLookupClass}"/> +#end #if ($stringUtils.isNotBlank($hibernateTransactionFlushBeforeCompletion)) <property name="hibernate.transaction.flush_before_completion" value="${hibernateTransactionFlushBeforeCompletion}"/> #end |
From: Vance K. <va...@us...> - 2006-02-25 14:51:56
|
User: vancek Date: 06/02/25 06:51:54 Modified: andromda-ejb3/src/site site.xml Log: removed listener callback Revision Changes Path 1.4 +4 -5 cartridges/andromda-ejb3/src/site/site.xml Index: site.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/site.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- site.xml 23 Feb 2006 08:25:34 -0000 1.3 +++ site.xml 25 Feb 2006 14:51:54 -0000 1.4 @@ -17,7 +17,7 @@ </menu> <menu name="How-to"> <item name="Introduction" href="howto.html"/> - <item name="Entity POJOs" href="howto1.html"/> + <item name="Entity" href="howto1.html"/> <item name="Relationships" href="howto2.html"/> <item name="Service Beans" href="howto3.html"/> <item name="Composite Primary Key" href="howto4.html"/> @@ -26,13 +26,12 @@ <item name="Exceptions" href="howto7.html"/> <item name="Security" href="howto8.html"/> <item name="Inheritance" href="howto9.html"/> - <item name="Message Driven Beans" href="howto10.html"/> + <item name="Message-Driven Beans" href="howto10.html"/> <item name="Environment Entry Injections" href="howto11.html"/> <item name="Service Delegates" href="howto12.html"/> <item name="Interceptors" href="howto13.html"/> - <item name="Listener Callback" href="howto14.html"/> - <item name="Transactions" href="howto15.html"/> - <item name="Manageable Entities" href="howto16.html"/> + <item name="Transactions" href="howto14.html"/> + <item name="Manageable Entities" href="howto15.html"/> <item name="Tips & Tricks" href="tips.html"/> </menu> </body> |
From: Vance K. <va...@us...> - 2006-02-25 14:48:38
|
User: vancek Date: 06/02/25 06:48:37 Added: andromda-ejb3/src/site/xdoc howto10.xml Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/site/xdoc/howto10.xml Index: howto10.xml =================================================================== <?xml version="1.0" encoding="iso-8859-1"?> <document> <properties> <author email="va...@us...">Vance Karimi</author> <title>AndroMDA - EJB3 - Message Driven Beans</title> </properties> <body> <section name="Message Driven Beans"> <p> A message driven bean is simply an 'asynchronous message consumer'. It is invoked by the container when a message is received at the destination that the MDB services. There is no client side visibility or conversational state with MDBs and the lifetime of the MDB instance is totally controlled by the container. </p> <p> The EJB 3.0 spec states: <i> <p> A message-driven bean instance has no state for a specific client. However, the instance variables of the message-driven bean instance can contain state accross the handling of client messages. Examples of such state include an open database connection and a reference to an enterprise bean. </p> <p> A further goal of the message-driven bean model is to allow for the concurrent processing of a stream of messages by means of container-provided pooling of message-driven bean instances. </p> </i> </p> <p> Like a session bean, the EJB3 cartridge generates a message driven bean class which should NOT be modified manually and a corresponding implementation class that requires the business logic for message processing. The MDB class contains all the necessary annotations. The MDB implementation class extends the MDB class. </p> <p> Currently, EJB3 cartridge does not generate the <code>@MessageDriven</code> metadata annotation in the MDB class. Instead, the <code>ejb-jar.xml</code> and <code>jboss.xml</code> deployment descriptors contain the necessary metadata, due to the design of separation by inheritance where the business logic is separated in the subclass from the auto-generated code in the base class. </p> <p> The <code>abstract</code> message-driven bean class defines all the business methods as abstract. The message-driven bean implementation class requires the business method implementations. The implementation class also contains the implementation of the <code>onMessage</code> callback in the <code>MessageListener</code>. </p> <p> The following examples illustrates how the EJB3 cartridge will generate the message-drive bean related classes and the required references in the session bean classes. The <code>PaymentProcessor</code> is the message-driven bean that is servicing the <code>Queue</code> which is located at <code>queue/howtomodel/howto10a</code>. The tagged values used are explained further down. </p> <p> <img src="images/org/andromda/test/10/a/uml.gif"/> </p> <p> <ul> <li class="gen">Auto-generated source that does not need manual editing</li> <li class="impl">Auto-generated source that should be edited manually</li> <li class="changed">File that is affected by the modifications applied in this section</li> </ul> </p> <p> <ul> <li class="gen"><a href="src/org/andromda/test/howto10/a/CarEmbeddable.java.txt"><code>CarEmbeddable.java</code></a></li> <li class="impl"><a href="src/org/andromda/test/howto10/a/Car.java.txt"><code>Car.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto10/a/CarType.java.txt"><code>CarType.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto10/a/PersonEmbeddable.java.txt"><code>PersonEmbeddable.java</code></a></li> <li class="impl"><a href="src/org/andromda/test/howto10/a/Person.java.txt"><code>Person.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/ServiceLocator.java.txt"><code>ServiceLocator.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/RentalServiceBean.java.txt"><code>RentalServiceBean.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto10/a/RentalServiceRemote.java.txt"><code>RentalServiceRemote.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto10/a/RentalServiceDelegate.java.txt"><code>RentalServiceDelegate.java</code></a></li> <li class="impl"><a href="src/org/andromda/test/howto10/a/RentalServiceBeanImpl.java.txt"><code>RentalServiceBeanImpl.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto10/a/RentalServiceException.java.txt"><code>RentalServiceException.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto10/a/RentalException.java.txt"><code>RentalException.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/PaymentServiceBean.java.txt"><code>PaymentServiceBean.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/PaymentServiceRemote.java.txt"><code>PaymentServiceRemote.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/PaymentServiceDelegate.java.txt"><code>PaymentServiceDelegate.java</code></a></li> <li class="impl"><a class="changed" href="src/org/andromda/test/howto10/a/PaymentServiceBeanImpl.java.txt"><code>PaymentServiceBeanImpl.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/PaymentServiceException.java.txt"><code>PaymentServiceException.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/PaymentProcessorMDBBean.java.txt"><code>PaymentProcessorMDBBean.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/PaymentProcessorMDBBeanImpl.java.txt"><code>PaymentProcessorMDBBeanImpl.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/ejb-jar.xml.txt"><code>ejb-jar.xml</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto10/a/jboss.xml.txt"><code>jboss.xml</code></a></li> </ul> </p> <p> The dependency from the <code>RentalService</code> session bean to the <code>PaymentProcessor</code> MDB injects the required connection factory and destination objects into the session bean. Similarly, the dependency from the <code>PaymentProcessor</code> MDB to the <code>PaymentService</code> session bean injects the EJB instance of the session bean into the MDB. </p> <a name="Destination_Type"/> <subsection name="Destination Type"> <p> For every message-driven bean, you <i>MUST</i> specify the destination type for the servicing MDB. This is achieved by simply modelling the <code>@andromda.ejb.mdb.destination.type</code> tagged value on the MDB class. Your options are: <ul> <li> <p> <b>javax.jms.Queue</b> </p> <p> If you have only ONE listener on a destination, then you specify the destination type as a Queue. </p> </li> <li> <p> <b>javax.jms.Topic</b> </p> <p> If you have multiple subscribers on a destination, then you specify the destination as a Topic. </p> </li> </ul> </p> </subsection> <a name="Destination"/> <subsection name="Destination"> <p> For every message-driven bean, you <i>MUST</i> specify the destination queue or topic name that the MDB is associated with. This is achieved by modelling the <code>@andromda.ejb.mdb.destination</code> tagged value. </p> </subsection> <a name="Acknowledge_Mode"/> <subsection name="Acknowledge Mode"> <p> To specify the acknowledge mode for a JMS message driven bean, simply model the <code>@andromda.ejb.mdb.acknowledge.mode</code> tagged value on the class. This only needs to be specified if <code>DUPS_OK_ACKNOWLEDGE</code> mode is required since the default is <code>AUTO_ACKNOWLEDGE</code>. </p> </subsection> <a name="Message_Selector"/> <subsection name="Message Selector"> <p> By specifying a message selector constraint, you can limit the messages that a message-driven bean is configured to received. To set a message selector, simply model the <code>@andromda.ejb.mdb.selector</code> tagged value on the MDB class. </p> </subsection> <a name="Subscription_Durability"/> <subsection name="Subscription Durability"> <p> You can specify the message-driven bean subscription durability by modelling the <code>@andromda.ejb.mdb.subscription.durability</code> tagged value on the MDB class. Queues are always durable by default. The durability only needs to specified on Topics. By default, Topics are <b>non-durable</b>. Your options are: <ul> <li>Durable</li> <li>NonDurable</li> </ul> </p> </subsection> <a name="Listener_Interceptor"/> <subsection name="Listener Interceptor"> <p> Message driven beans have lifecycle callback interceptor methods which can be defined in a separate interceptor class using the EJB3 cartridge. To find out more information on this, click on <a href="howto13.html">interceptors</a>. </p> </subsection> <a name="Transaction_Context"/> <subsection name="Transaction Context"> <p> Like session beans, message-driven beans can use container-managed or bean-managed transaction demarcation. By default and if unspecified, the container-managed transaction demarcation is adopted. However, you can specify bean-managed transaction demarcation by modelling the <code>@andromda.ejb.transaction.management</code> tagged value to <code>BEAN</code> on the message-driven class. </p> <p> If the MDB is specified using container-managed transaction demarcation, you can specify the transaction attribute type to either: <ul> <li>REQUIRED</li> <li>NOT_SUPPORTED</li> </ul> By default, the EJB3 cartridge will generate the <code>@TransactionAttribute</code> annotation, setting the attribute type to <code>REQUIRED</code>. To override this default value, you can model the <code>@andromda.ejb.transaction.type</code> tagged value on the MDB class. </p> </subsection> <a name="Security"/> <subsection name="Security"> <p> Because message-driven beans lifecycle is totally controlled by the container, a client is NOT calling the <code>onMessage</code> method directly. Therefore, the security identity for the execution of methods in the MDB is controlled via the <code>@RunAs</code> annotation. This can easily be set by following the security howto <a href="howto8.html#Modelling">here</a>. </p> </subsection> <a name="Message_Driven_Context"/> <subsection name="Message Driven Context"> The EJB3 cartridge injects the <code>MessageDrivenContext</code> into every MDB using the <code>@Resource</code> annotation by default. The <code>MessageDrivenContext</code> instance, named <code>context</code>, provides the following methods: <ul> <li>setRollbackOnly</li> <li>getRollbackOnly</li> <li>getUserTransaction</li> <li>getTimerService</li> <li>getCallerPrincipal</li> <li>isCallerInRole</li> <li>getEJBHome</li> <li>getEJBLocalHome</li> <li>lookup</li> </ul> </subsection> <a name="Session_Bean_Injection"/> <subsection name="Session Bean Injection"> To inject a session bean into the MDB, model a dependency from the MDB to the destination session bean. As a result, the <code>EJB</code> annotation will be generation on the attribute declaring the injected destination session bean. </subsection> <a name="Resource_Injection"/> <subsection name="Resource Injections"> <p> To inject an environment entry resource value, model an attribute with classifer scope and set the attribute stereotype to <![CDATA[<<EnvEntry>>]]>. The environment entries will be defined in the MDB class and configured in the ejb-jar.xml deployment descriptor. You must define a default value for these attributes in the model. Refer to <a href="howto11.html">Environment Entry Injections</a> for further information. </p> </subsection> </section> <section name="Next"> <p> To find out how to inject environment entries to session and message driven beans, click <a href="howto11.html">here</a>. </p> </section> </body> </document> |
From: Vance K. <va...@us...> - 2006-02-25 14:48:24
|
User: vancek Date: 06/02/25 06:48:22 Modified: andromda-ejb3/src/site/xdoc howto.xml Log: added message-driven table Revision Changes Path 1.4 +12 -0 cartridges/andromda-ejb3/src/site/xdoc/howto.xml Index: howto.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/xdoc/howto.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- howto.xml 24 Feb 2006 06:05:49 -0000 1.3 +++ howto.xml 25 Feb 2006 14:48:22 -0000 1.4 @@ -102,6 +102,18 @@ <li><a href="howto9.html#Helpful_Hints">Helpful Hints</a></li> </ul> </li> + <li> + <a href="howto10.html">Message-Driven Beans</a> + <ul> + <li><a href="howto10.html#Destination_Type">Destination Type</a></li> + <li><a href="howto10.html#Destination">Destination</a></li> + <li><a href="howto10.html#Discriminator_Components">Discriminator Components</a></li> + <li><a href="howto10.html#Table_Per_Class_Strategy">Table Per Class Strategy</a></li> + <li><a href="howto10.html#Table_Join_Strategy">Table Join Strategy</a></li> + <li><a href="howto10.html#Generic_Finder_Methods">Generic Finder Methods</a></li> + <li><a href="howto10.html#Helpful_Hints">Helpful Hints</a></li> + </ul> + </li> </ul> </p> <p> |
From: Vance K. <va...@us...> - 2006-02-25 14:47:42
|
User: vancek Date: 06/02/25 06:47:38 Added: andromda-ejb3/src/site/resources/images/org/andromda/test/10/a uml.gif Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/site/resources/images/org/andromda/test/10/a/uml.gif <<Binary file>> |
From: Vance K. <va...@us...> - 2006-02-25 14:47:33
|
User: vancek Date: 06/02/25 06:47:31 cartridges/andromda-ejb3/src/site/resources/images/org/andromda/test/10/a - New directory |
From: Vance K. <va...@us...> - 2006-02-25 14:47:32
|
User: vancek Date: 06/02/25 06:47:31 cartridges/andromda-ejb3/src/site/resources/images/org/andromda/test/10 - New directory |
From: Vance K. <va...@us...> - 2006-02-25 14:47:08
|
User: vancek Date: 06/02/25 06:47:02 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java Log: renamed SERVICE_TRANSACTION_MANAGEMENT to TRANSACTION_MANAGEMENT profile element reference Revision Changes Path 1.14 +2 -2 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.13 retrieving revision 1.14 diff -u -w -r1.13 -r1.14 --- EJB3Profile.java 9 Feb 2006 07:16:07 -0000 1.13 +++ EJB3Profile.java 25 Feb 2006 14:47:02 -0000 1.14 @@ -159,9 +159,9 @@ /** * The tagged value indicating the transaction demarcation * strategy. This only applies at the class level of a - * session bean. + * session and message-driven bean. */ - public static final String TAGGEDVALUE_EJB_TRANSACTION_MANAGEMENT = profile.get("SERVICE_TRANSACTION_MANAGEMENT"); + public static final String TAGGEDVALUE_EJB_TRANSACTION_MANAGEMENT = profile.get("TRANSACTION_MANAGEMENT"); /** * The tagged value indicating whether to not allow synthetic |
From: Vance K. <va...@us...> - 2006-02-25 14:45:52
|
User: vancek Date: 06/02/25 06:45:51 Modified: andromda-ejb3/src/main/resources/META-INF/andromda profile.xml Log: renamed SERVICE_TRANSACTION_MANAGEMENT element to TRANSACTION_MANAGEMENT renamed @andromda.service.transaction.management to @andromda.ejb.transaction.management is now applied on service and message-driven beans Revision Changes Path 1.18 +7 -6 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.17 retrieving revision 1.18 diff -u -w -r1.17 -r1.18 --- profile.xml 20 Feb 2006 05:17:16 -0000 1.17 +++ profile.xml 25 Feb 2006 14:45:51 -0000 1.18 @@ -783,22 +783,23 @@ <![CDATA[<<Service>>]]> </appliedOnElement> </element> - <element name="SERVICE_TRANSACTION_MANAGEMENT"> + <element name="TRANSACTION_MANAGEMENT"> <documentation> Specifies the transaction demarcation strategy - for the session bean. By default, this does not + for session and message-driven beans. + By default, this does not need to be set for CONTAINER managed transaction demarcation. </documentation> <value> - @andromda.service.transaction.management + @andromda.ejb.transaction.management </value> <appliedOnElement> - Service + Service and Message-Driven Beans </appliedOnElement> <allowedValues> - <value default="true">BEAN</value> - <value>CONTAINER</value> + <value default="true">CONTAINER</value> + <value>BEAN</value> </allowedValues> </element> <element name="SECURITY_PERMIT_ALL"> |
From: Vance K. <va...@us...> - 2006-02-25 14:43:41
|
User: vancek Date: 06/02/25 06:43:41 Modified: andromda-ejb3/src/main/resources/templates/ejb3 MessageDrivenBean.vsl Log: comment change Revision Changes Path 1.9 +1 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBean.vsl Index: MessageDrivenBean.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBean.vsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- MessageDrivenBean.vsl 9 Feb 2006 09:22:18 -0000 1.8 +++ MessageDrivenBean.vsl 25 Feb 2006 14:43:41 -0000 1.9 @@ -17,7 +17,7 @@ * The annotation is commented to avoid multiple registration with the * container. * - * javax.ejb.MessageDriven(activateConfig = + * javax.ejb.MessageDriven(activationConfig = *{ * @javax.ejb.ActivationConfigProperty(propertyName="destinationType", propertyValue="${mdb.destinationType}"), * @javax.ejb.ActivationConfigProperty(propertyName="destination", propertyValue="${mdb.destination}")#if ($mdb.acknowledgeMode || $mdb.messageSelector || $mdb.subscriptionDurability),#end |
From: Vance K. <va...@us...> - 2006-02-25 14:43:12
|
User: vancek Date: 06/02/25 06:43:11 Modified: andromda-ejb3/src/main/resources/templates/ejb3 EntityEmbeddable.vsl Log: discriminator components are only generated for single table hierarchy Revision Changes Path 1.18 +15 -2 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.17 retrieving revision 1.18 diff -u -w -r1.17 -r1.18 --- EntityEmbeddable.vsl 22 Feb 2006 06:12:55 -0000 1.17 +++ EntityEmbeddable.vsl 25 Feb 2006 14:43:11 -0000 1.18 @@ -54,7 +54,10 @@ ## #if ($entity.requiresSpecializationMapping && !$entity.embeddableSuperclass) @javax.persistence.Inheritance(strategy = javax.persistence.InheritanceType.${entity.inheritanceStrategy}) -#**##if ($entity.inheritanceSingleTable || $entity.inheritanceJoined) +## +## Discriminator components only apply to single table mapping strategy +## +#**##if ($entity.inheritanceSingleTable) #* *##set ($argExists = false) @javax.persistence.DiscriminatorColumn(#if ($entity.discriminatorColumn)name = "${entity.discriminatorColumn}"#set ($argExists = true)#end#if ($entity.discriminatorType)#if ($argExists), #end#**#discriminatorType = javax.persistence.DiscriminatorType.${entity.discriminatorType}#set ($argExists = true)#end#if ($entity.discriminatorColumnDefinition)#if ($argExists), #end#**#columnDefinition = "${entity.discriminatorColumnDefinition}"#set ($argExists = true)#end#if ($entity.discriminatorLength > 0)#if ($argExists), #end#**#length = ${entity.discriminatorLength}#end) @javax.persistence.DiscriminatorValue("${entity.discriminatorValue}") @@ -604,9 +607,13 @@ // ----------- Generic Finder Methods -------------- +## ## Do not include the findAll finder for inheriting classes when the ## inheritance strategy is single table. This is defined in the base -## class. Only render if the findAll finder hasn't been modelled. +## class. +## +## Only render if the findAll finder hasn't been modelled. +## #**##if ((($entity.inheritanceSingleTable && !$entity.requiresGeneralizationMapping) || !$entity.inheritanceSingleTable) && !$entity.finderFindAllExists) /** * Returns the collection of all ${entity.name}s. @@ -614,20 +621,26 @@ * @param em javax.persistence.EntityManager * @return all available ${entity.name} objects */ +## ## For inheriting classes, replace findAll with findAll${entity.name}s +## public static java.util.Collection<${entity.name}> findAll#if ($entity.requiresGeneralizationMapping)$stringUtils.capitalize(${entity.name})s#end(javax.persistence.EntityManager em) { return em.createQuery("FROM ${entity.name} AS $stringUtils.uncapitalize(${entity.name})").getResultList(); } #**##end +## ## Only include the findByPrimaryKey method if not an inheriting class. ## Classes that inherit from a base class use the primary key identifier ## of the base class. The inheritence relationship is reflected in the ## queries, so queries based on the base/root class are polymorphic. +## ## Do not include the findByPrimaryKey if this bean has a composite ## primary key class. +## ## Only render if the findAll finder hasn't been modelled. +## #**##if (!$entity.compositePrimaryKeyPresent && !$entity.requiresGeneralizationMapping && !$entity.finderFindByPrimaryKeyExists) #* *##foreach ($attribute in $entity.getIdentifiers(false)) #* *##set ($identifierName = $attribute.name) |
From: Vance K. <va...@us...> - 2006-02-24 06:07:28
|
User: vancek Date: 06/02/23 22:07:21 Added: andromda-ejb3/src/site/xdoc howto9.xml Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/site/xdoc/howto9.xml Index: howto9.xml =================================================================== <?xml version="1.0" encoding="iso-8859-1"?> <document> <properties> <author email="va...@us...">Vance Karimi</author> <title>AndroMDA - EJB3 - HowTo Inheritance</title> </properties> <body> <section name="Inheritance"> <p> The EJB 3.0 specification introduces inheritance: </p> <i> <p> An entity may inherit from another entity class. Entities support inheritance, polymorphic associations, and polymorphic queries. </p> <p> Both abstract and concrete classes can be entities. Both abstract and concrete classes can be annotated with the <code>Entity</code> annotation, mapped as entities, and queried for as entities. </p> <p> Entities can extend non-entity classes and non-entity classes can extend entity classes. </p> </i> <p> The following howto should give you a basic understanding on how to model your inheritance hierarchies using the EJB3 cartridge. </p> <p> The biggest drawback of implementing any of the inheritance hierarchies using the EJB3 cartridge is the limitation where a manual source class is NOT available in the child nodes of an inheritance hierarchy. Because the EJB3 cartridge employs mapped superclass inheritance for every entity to be able to provide implementation specific source in the subclass, it is limited by the fact that mapped superclasses can only exist in the root node of the inheritance hierarchy. </p> <a name="Mapped_Superclasses"/> <subsection name="Mapped Superclasses"> <p> In a mapped superclass scenario, an entity inherits from a superclass that has persistent state and mapping information, but the super class isn't an entity. This is the strategy employed by the EJB3 cartridge when generating non-inheriting entities. A mapped superclass is generated containing almost all of the mapping information. The subclass contains only the <code>@Entity</code> , <code>@Table</code> and <code>@EntityListeners</code> annotations. All attribute and relationship mapping information exists in the mapped superclass. The mapped superclass is regenerated on every run, however the subclass is not. As soon as you model inheriting entities, this strategy doesn't apply since mapped superclasses only exist at the root node of the hierarchy. </p> <p> To explicity defined an entity as a mapped superclass, model the <![CDATA[<<MappedSuperclass>>]]> stereotype on the root entity. Define the subclass entities <b>without</b> primary keys and generalizing the root entity. The following is an example of this type of inheritance. </p> <p> <img src="images/org/andromda/test/9/a/uml.gif"/> </p> <p> <ul> <li class="gen">Auto-generated source that does not need manual editing</li> <li class="impl">Auto-generated source that should be edited manually</li> <li class="changed">File that is affected by the modifications applied in this section</li> </ul> </p> <p> <ul> <li class="gen"><a class="changed" href="src/org/andromda/test/howto9/a/Vehicle.java.txt"><code>Vehicle.java</code></a></li> <li class="impl"><a class="changed" href="src/org/andromda/test/howto9/a/Car.java.txt"><code>Car.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/a/CarType.java.txt"><code>CarType.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/a/PersonEmbeddable.java.txt"><code>PersonEmbeddable.java</code></a></li> <li class="impl"><a href="src/org/andromda/test/howto9/a/Person.java.txt"><code>Person.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/ServiceLocator.java.txt"><code>ServiceLocator.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/a/RentalServiceBean.java.txt"><code>RentalServiceBean.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/a/RentalServiceRemote.java.txt"><code>RentalServiceRemote.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/a/RentalServiceDelegate.java.txt"><code>RentalServiceDelegate.java</code></a></li> <li class="impl"><a href="src/org/andromda/test/howto9/a/RentalServiceBeanImpl.java.txt"><code>RentalServiceBeanImpl.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/a/RentalServiceException.java.txt"><code>RentalServiceException.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/a/RentalException.java.txt"><code>RentalException.java</code></a></li> </ul> </p> <p> It's worthwhile to note that only a Vehicle class is generated which contains all the mapping information. This class is regenerated every time AndroMDA runs; any manual changes to this class is overwritten. Likewise, only the Car entity class, with all mapping information is generated. On the other hand, the Person entity operates under the normal EJB3 cartridge guidelines since there is no inheritance hierarchy for this entity. Therefore, a <code>Person</code> and <code>PersonEmbeddable</code> class is generated and you are allowed to manually edit the <code>Person</code> class source file. </p> </subsection> <a name="Single_Table_Strategy"/> <subsection name="Single Table Strategy"> <p> In this strategy, the complete class hierarchy is persisted to a single table. To differentiate between class types, a discriminator column is used. The discriminator column type is specified in the root class along with the inheritance strategy employed. All classes need to specify the discriminator value associated to each class in the hierarchy. </p> <p> If the query is based on the root class in the hierarchy, the query is polymorphic which implies that entity subclass instances will be returned. </p> <p> <b>Pros:</b> Good support for polymorphic relationships between entities and queries over the class hierarchy. </p> <p> <b>Cons:</b> Columns corresponding to state of subclasses must be nullable. </p> <p> The EJB3 cartridge will assume a single table mapping strategy when you model an inheritance hierarchy between entities, unless specified otherwise. </p> <p> <img src="images/org/andromda/test/9/b/uml.gif"/> </p> <p> <ul> <li class="gen">Auto-generated source that does not need manual editing</li> <li class="impl">Auto-generated source that should be edited manually</li> <li class="changed">File that is affected by the modifications applied in this section</li> </ul> </p> <p> <ul> <li class="impl"><a href="src/org/andromda/test/howto9/b/Vehicle.java.txt"><code>Vehicle.java</code></a></li> <li class="gen"><a class="changed" href="src/org/andromda/test/howto9/b/VehicleEmbeddable.java.txt"><code>VehicleEmbeddable.java</code></a></li> <li class="impl"><a class="changed" href="src/org/andromda/test/howto9/b/Car.java.txt"><code>Car.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/b/CarType.java.txt"><code>CarType.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/b/PersonEmbeddable.java.txt"><code>PersonEmbeddable.java</code></a></li> <li class="impl"><a href="src/org/andromda/test/howto9/b/Person.java.txt"><code>Person.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/ServiceLocator.java.txt"><code>ServiceLocator.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/b/RentalServiceBean.java.txt"><code>RentalServiceBean.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/b/RentalServiceRemote.java.txt"><code>RentalServiceRemote.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/b/RentalServiceDelegate.java.txt"><code>RentalServiceDelegate.java</code></a></li> <li class="impl"><a href="src/org/andromda/test/howto9/b/RentalServiceBeanImpl.java.txt"><code>RentalServiceBeanImpl.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/b/RentalServiceException.java.txt"><code>RentalServiceException.java</code></a></li> <li class="gen"><a href="src/org/andromda/test/howto9/b/RentalException.java.txt"><code>RentalException.java</code></a></li> </ul> </p> <p> The discriminator components are discussed in immediately below. </p> </subsection> <a name="Discriminator_Components"/> <subsection name="Discriminator Components"> <p> The EJB3 cartridge provides a few tagged values to customise the default values for the discriminator components for a single table inheritance mapping strategy. </p> <p> The discriminator column name defaults to <code>TYPE</code> of type <code>STRING</code>. To set the discriminator column name, you model the <code>@andromda.persistence.discriminator.colum.name</code> tagged value on the root class. </p> <p> To specify the discriminator colum type, you model the <code>@andromda.persistence.discriminator.type</code> tagged value on the root class. Your column type options are: <ul> <li>STRING</li> <li>INTEGER</li> <li>CHAR</li> </ul> </p> <p> You can set the discriminator column length if the colum type is specified as <code>STRING</code> by modelling the <code>@andromda.persistence.discriminator.column.length</code> tagged value on the root class. The default is 10. </p> <p> In some cases, you may want to explicity define the SQL fragment when generating the DDL for the discriminator column. To do this, simply model the <code>@andromda.persistence.discriminator.colum.definition</code> tagged value on the root class. </p> <p> Most importantly, you need to model the <code>@andromda.persistence.discriminator.value</code> tagged value <b>on all classes</b> in the hierarchy. This value indicates the row in the table is an entity of the annotated entity type. This is shown in the above diagram on entities Vehicle and Car. </p> </subsection> <a name="Table_Per_Class_Strategy"/> <subsection name="Table Per Class Strategy"> <p> With this strategy, a table exists per class in the hierarchy and each table is comprised of all the properties persistent by that class. There is no need to define discriminator column types or values here. </p> <p> If the query is based on the root class in the hierarchy, the query is polymorphic which implies that entity subclass instances will be returned. </p> <p> <b>Cons:</b> Poor support for polymorphic relationships. A separate SQL query per subclass is required before queries are executed. </p> <p> Since the default inheritance mapping strategy is single table per hierarchy, you can model the <code>@andromda.persistence.inheritance</code> tagged value and set it to <code>TABLE_PER_CLASS</code> on the root class of the hierarchy. All subclasses follow this same strategy. </p> </subsection> <a name="Table_Join_Strategy"/> <subsection name="Table Join Strategy"> <p> This strategy has a table per class in the hierarchy, however the subclass tables are comprised of ONLY the extra attributes defined in the subclass and not the inheriting fields. There is no need to define discriminator column types or values here. The primary key column(s) of the subclass table serves as a foreign key to the primary key of the superclass table. </p> <p> If the query is based on the root class in the hierarchy, the query is polymorphic which implies that entity subclass instances will be returned. </p> <p> <b>Cons:</b> Perhaps more than 1 join operation is needed to instantiate instances of a subclass. </p> <p> Since the default inheritance mapping strategy is single table per hierarchy, you can model the <code>@andromda.persistence.inheritance</code> tagged value and set it to <code>JOINED</code> on the root class of the hierarchy. All subclasses follow this same strategy. </p> </subsection> <a name="Generic_Finder_Methods"/> <subsection name="Generic Finder Methods"> <p> You will notice that the generic finder method <code>findByPrimaryKey</code> is not generated for any of the inheritance mapping strategies within the inheriting subclasses. Classes that inherit from a base class use the primary key identifier of the base class. Therefore, because the <code>findByPrimaryKey</code> already exists in the base/root class and since we have polymorphic queries, subclass entities are also returned from the queries of the root class. </p> <p> The case is different for the <code>findAll</code> finder method. The <code>findAll</code> finder will not be generated for inheriting subclasses when the inheritance strategy is single table. Polymorphic queries in the root entity returns the result from all classes in the hierarchy. For table per class and joined table mapping strategies, the cartridge will generate the <code>findAll<![CDATA[<Entity Name>]]></code> finder method in each subclass as well as the <code>findAll</code> in the root class. </p> </subsection> <a name="Helpful_Hints"/> <subsection name="Helpful Hints"> <p> The PFD EJB 3.0 spec says: </p> <i> <p> Support for the table per class inheritance mapping strategy is optional in this release. </p> <p> Support for the combination of inheritance strategies within a single entity inheritance hierarchy is not required by this specification. </p> </i> </subsection> </section> <section name="Next"> <p> To learn how to develop Message Driven Beans, click <a href="howto9.html">here</a>. </p> </section> </body> </document> |