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-09 04:43:39
|
User: vancek Date: 06/03/08 20:43:38 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3MessageDrivenFacadeLogicImpl.java Log: implemented getInterceptorReferences and isExcludeDefaultInterceptors Revision Changes Path 1.6 +71 -7 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.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- EJB3MessageDrivenFacadeLogicImpl.java 29 Jan 2006 01:56:26 -0000 1.5 +++ EJB3MessageDrivenFacadeLogicImpl.java 9 Mar 2006 04:43:38 -0000 1.6 @@ -1,8 +1,10 @@ package org.andromda.cartridges.ejb3.metafacades; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; +import java.util.LinkedHashSet; import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; @@ -10,8 +12,11 @@ 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.StringUtils; @@ -281,7 +286,9 @@ public Collection getServiceReferences() { Collection references = super.getServiceReferences(); - CollectionUtils.filter(references, new Predicate() + CollectionUtils.filter( + references, + new Predicate() { public boolean evaluate(Object object) { @@ -342,4 +349,61 @@ return this.hasStereotype(EJB3Profile.STEREOTYPE_LISTENER); } + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacadeLogic#handleGetInterceptorReferences() + */ + protected Collection handleGetInterceptorReferences() + { + Collection references = this.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)); + } + }); + CollectionUtils.transform( + references, + new Transformer() + { + public Object transform(final Object object) + { + return ((DependencyFacade)object).getTargetElement(); + } + }); + final Collection interceptors = new LinkedHashSet(references); + CollectionUtils.forAllDo( + references, + new Closure() + { + public void execute(Object object) + { + if (object instanceof EJB3InterceptorFacade) + { + interceptors.addAll(((EJB3InterceptorFacade)object).getInterceptorReferences()); + } + } + }); + return interceptors; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacadeLogic#handleIsExcludeDefaultInterceptors() + */ + protected boolean handleIsExcludeDefaultInterceptors() + { + boolean excludeDefault = false; + String excludeDefaultStr = + (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_SERVICE_INTERCEPTOR_EXCLUDE_DEFAULT); + if (excludeDefaultStr != null) + { + excludeDefault = BooleanUtils.toBoolean(excludeDefaultStr); + } + return excludeDefault; + } + } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-03-09 04:41:41
|
User: vancek Date: 06/03/08 20:41:41 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3InterceptorFacadeLogicImpl.java Log: implemented isDefaultInterceptor and getInterceptorReferences Revision Changes Path 1.2 +62 -1 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3InterceptorFacadeLogicImpl.java Index: EJB3InterceptorFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3InterceptorFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3InterceptorFacadeLogicImpl.java 17 Jan 2006 03:51:10 -0000 1.1 +++ EJB3InterceptorFacadeLogicImpl.java 9 Mar 2006 04:41:41 -0000 1.2 @@ -1,7 +1,18 @@ package org.andromda.cartridges.ejb3.metafacades; import java.text.MessageFormat; - +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashSet; + +import org.andromda.cartridges.ejb3.EJB3Profile; +import org.andromda.metafacades.uml.DependencyFacade; +import org.andromda.metafacades.uml.ModelElementFacade; +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.StringUtils; @@ -46,4 +57,54 @@ null); } + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacadeLogic#handleGetInterceptorReferences() + */ + protected Collection handleGetInterceptorReferences() + { + Collection references = this.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)); + } + }); + CollectionUtils.transform( + references, + new Transformer() + { + public Object transform(final Object object) + { + return ((DependencyFacade)object).getTargetElement(); + } + }); + final Collection interceptors = new LinkedHashSet(references); + CollectionUtils.forAllDo( + references, + new Closure() + { + public void execute(Object object) + { + if (object instanceof EJB3InterceptorFacade) + { + interceptors.addAll(((EJB3InterceptorFacade)object).getInterceptorReferences()); + } + } + }); + return interceptors; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacadeLogic#handleIsDefaultInterceptor() + */ + protected boolean handleIsDefaultInterceptor() + { + return this.hasStereotype(EJB3Profile.STEREOTYPE_DEFAULT_INTERCEPTOR); + } + } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-03-09 04:38:12
|
User: vancek Date: 06/03/08 20:38:12 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java Log: declared STEREOTYPE_DEFAULT_INTERCEPTOR Revision Changes Path 1.18 +6 -1 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.17 retrieving revision 1.18 diff -u -w -r1.17 -r1.18 --- EJB3Profile.java 7 Mar 2006 09:22:01 -0000 1.17 +++ EJB3Profile.java 9 Mar 2006 04:38:11 -0000 1.18 @@ -94,11 +94,16 @@ public static final String STEREOTYPE_DATA_SOURCE = profile.get("DATA_SOURCE"); /** - * Represents an class for a session bean. + * Represents an interceptor class for a session or message-driven bean. */ public static final String STEREOTYPE_INTERCEPTOR = profile.get("INTERCEPTOR"); /** + * Represents a default interceptor for a session or message-driven bean. + */ + public static final String STEREOTYPE_DEFAULT_INTERCEPTOR = profile.get("DEFAULT_INTERCEPTOR"); + + /** * Represents a dependency from an actor that is identified to * apply a run-as identity to the bean when making calls. */ |
From: Vance K. <va...@us...> - 2006-03-09 04:37:28
|
User: vancek Date: 06/03/08 20:37:28 Modified: andromda-ejb3/src/main/resources/META-INF/andromda profile.xml Log: added DEFAULT_INTERCEPTOR stereotype element Revision Changes Path 1.22 +11 -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.21 retrieving revision 1.22 diff -u -w -r1.21 -r1.22 --- profile.xml 7 Mar 2006 09:20:50 -0000 1.21 +++ profile.xml 9 Mar 2006 04:37:27 -0000 1.22 @@ -168,6 +168,17 @@ class </appliedOnElement> </element> + <element name="DEFAULT_INTERCEPTOR"> + <documentation> + Defines a custome made default interceptor for + all the business methods of all session and message + driven beans within this deployment. + </documentation> + <value>DefaultInterceptor</value> + <appliedOnElement> + class + </appliedOnElement> + </element> <element name="LISTENER"> <documentation> Defines a callback listener class for the entity, |
From: Vance K. <va...@us...> - 2006-03-09 04:35:48
|
User: vancek Date: 06/03/08 20:35:47 Modified: andromda-ejb3/src/main/resources/META-INF/andromda metafacades.xml Log: added EJB3InterceptorFacadeLogicImpl metafacade definition Revision Changes Path 1.17 +6 -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.16 retrieving revision 1.17 diff -u -w -r1.16 -r1.17 --- metafacades.xml 7 Mar 2006 09:19:48 -0000 1.16 +++ metafacades.xml 9 Mar 2006 04:35:47 -0000 1.17 @@ -166,6 +166,12 @@ </mapping> <property reference="interceptorNamePattern"/> </metafacade> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacadeLogicImpl" contextRoot="true"> + <mapping> + <stereotype>DEFAULT_INTERCEPTOR</stereotype> + </mapping> + <property reference="interceptorNamePattern"/> + </metafacade> <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3EnumerationFacadeLogicImpl"> <mapping> <stereotype>ENUMERATION</stereotype> |
From: Vance K. <va...@us...> - 2006-03-09 04:34:29
|
User: vancek Date: 06/03/08 20:34:28 Modified: andromda-ejb3/src/main/resources/META-INF/andromda cartridge.xml Log: added interceptors variable to ejb-jar.xml.vsl template added services variable to persistence.xml.vsl template to generate persistence.xml Revision Changes Path 1.18 +8 -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.17 retrieving revision 1.18 diff -u -w -r1.17 -r1.18 --- cartridge.xml 7 Mar 2006 09:18:35 -0000 1.17 +++ cartridge.xml 9 Mar 2006 04:34:28 -0000 1.18 @@ -104,8 +104,11 @@ overwrite="true" outputToSingleFile="true" outputOnEmptyElements="false"> - <modelElements variable="persistenceContexts"> - <modelElement> + <modelElements> + <modelElement variable="services"> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"/> + </modelElement> + <modelElement variable="persistenceContexts"> <type name="org.andromda.cartridges.ejb3.metafacades.EJB3PersistenceContextFacade"/> </modelElement> </modelElements> @@ -235,6 +238,9 @@ <modelElement variable="mdbs"> <type name="org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacade"/> </modelElement> + <modelElement variable="interceptors"> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3InterceptorFacade"/> + </modelElement> <modelElement variable="manageables"> <type name="org.andromda.cartridges.ejb3.metafacades.EJB3ManageableEntityFacade"/> </modelElement> |
From: Vance K. <va...@us...> - 2006-03-09 04:32:06
|
User: vancek Date: 06/03/08 20:32:04 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionListener.vsl Log: fixed exception Revision Changes Path 1.5 +4 -4 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- SessionListener.vsl 2 Mar 2006 10:26:09 -0000 1.4 +++ SessionListener.vsl 9 Mar 2006 04:32:03 -0000 1.5 @@ -29,7 +29,7 @@ } catch (Exception ex) { - throw new RuntimeException(e); + throw new RuntimeException(ex); } } @@ -43,7 +43,7 @@ } catch (Exception ex) { - throw new RuntimeException(e); + throw new RuntimeException(ex); } } #if ($service.stateful) @@ -58,7 +58,7 @@ } catch (Exception ex) { - throw new RuntimeException(e); + throw new RuntimeException(ex); } } @@ -72,7 +72,7 @@ } catch (Exception ex) { - throw new RuntimeException(e); + throw new RuntimeException(ex); } } #end |
From: Vance K. <va...@us...> - 2006-03-09 04:31:23
|
User: vancek Date: 06/03/08 20:31:23 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionBean.vsl Log: moved class and method level interceptor definitions and default interceptor definition to ejb-jar descriptor Revision Changes Path 1.22 +19 -13 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.21 retrieving revision 1.22 diff -u -w -r1.21 -r1.22 --- SessionBean.vsl 7 Mar 2006 09:16:53 -0000 1.21 +++ SessionBean.vsl 9 Mar 2006 04:31:23 -0000 1.22 @@ -11,11 +11,11 @@ * $service.getDocumentation(" * ") */ -/** - * Do not specify the javax.ejb.${service.type} annotation - * Instead, define the session bean in the ejb-jar.xml descriptor - * javax.ejb.${service.type} - */ + +// Do not specify the javax.ejb.${service.type} annotation +// Instead, define the session bean in the ejb-jar.xml descriptor +// @javax.ejb.${service.type} + #if ($service.transactionManagement) @javax.ejb.TransactionManagement(javax.ejb.TransactionManagementType.${service.transactionManagement}) #end @@ -48,18 +48,21 @@ #if ($service.viewTypeRemote) @javax.ejb.Remote({${service.fullyQualifiedServiceRemoteInterfaceName}.class}) #end -## -## Service listener - lifecycle callbacks is defined as an interceptor -## + #set ($interceptors = $service.interceptorReferences) #if ($collectionUtils.size($interceptors) >= 1 || $service.listenerEnabled) #**##if ($service.listenerEnabled) #* *##set ($lifecycleCallback = "${service.fullyQualifiedServiceListenerName}.class") #**##else -#* *##set ($lifecycleCallback = "null") +#* *##set ($lifecycleCallback = "") #**##end -...@ja...erceptors({$transform.getInterceptorsAsList(${interceptors}, ${lifecycleCallback})}) +// Lifecycle callback listeners and interceptors are defined in ejb-jar.xml +// @javax.ejb.Interceptors({$transform.getInterceptorsAsList(${interceptors}, ${lifecycleCallback})}) #end +#if ($service.excludeDefaultInterceptors) +// @javax.ejb.ExcludeDefaultInterceptors +#end + public abstract class ${service.serviceName} #if($service.generalization) extends ${service.generalization.fullyQualifiedName}BeanImpl @@ -306,13 +309,16 @@ #* *##end #* *##set ($interceptors = $operation.interceptorReferences) #* *##if ($collectionUtils.size($interceptors) >= 1) - @javax.ejb.Interceptors({$transform.getInterceptorsAsList(${interceptors}, null)}) + // Interceptors are defined in ejb-jar.xml + // @javax.ejb.Interceptors({$transform.getInterceptorsAsList(${interceptors}, "")}) #* *##end #* *##if ($operation.excludeDefaultInterceptors) - @javax.ejb.ExcludeDefaultInterceptors + // Interceptor default exclusions are defined in ejb-jar.xml + // @javax.ejb.ExcludeDefaultInterceptors #* *##end #* *##if ($operation.excludeClassInterceptors) - @javax.ejb.ExcludeClassInterceptors + // Interceptor class exclusions are defined in ejb-jar.xm + // @javax.ejb.ExcludeClassInterceptors #* *##end $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #* *##if ($operation.exceptionsPresent) |
From: Vance K. <va...@us...> - 2006-03-09 04:30:13
|
User: vancek Date: 06/03/08 20:30:13 Modified: andromda-ejb3/src/main/resources/templates/ejb3 MessageDrivenListener.vsl Log: fixed throwing of exception Revision Changes Path 1.4 +2 -2 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- MessageDrivenListener.vsl 2 Mar 2006 10:18:15 -0000 1.3 +++ MessageDrivenListener.vsl 9 Mar 2006 04:30:12 -0000 1.4 @@ -29,7 +29,7 @@ } catch (Exception ex) { - throw new RuntimeException(e); + throw new RuntimeException(ex); } } @@ -43,7 +43,7 @@ } catch (Exception ex) { - throw new RuntimeException(e); + throw new RuntimeException(ex); } } } |
From: Vance K. <va...@us...> - 2006-03-09 04:29:26
|
User: vancek Date: 06/03/08 20:29:25 Modified: andromda-ejb3/src/main/resources/templates/ejb3 MessageDrivenBean.vsl Log: interceptor definition and default interceptor exclusion moved to ejb-jar descriptor Revision Changes Path 1.11 +31 -22 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.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- MessageDrivenBean.vsl 2 Mar 2006 10:15:42 -0000 1.10 +++ MessageDrivenBean.vsl 9 Mar 2006 04:29:25 -0000 1.11 @@ -11,34 +11,43 @@ $mdb.getDocumentation(" * ") */ -/** - * The MessageDriven annotation is now fully configured in ejb-jar.xml - * This allows to set the class name to the MDB implementation class - * The annotation is commented to avoid multiple registration with the - * container. - * - * 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 - * +// The MessageDriven annotation is now fully configured in ejb-jar.xml +// This allows to set the class name to the MDB implementation class +// The annotation is commented to avoid multiple registration with the +// container. +// @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 +// #if ($mdb.acknowledgeMode) - * @javax.ejb.ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="${mdb.acknowledgeMode}")#if ($mdb.messageSelector || $mdb.subscriptionDurability),#end - * +// @javax.ejb.ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="${mdb.acknowledgeMode}")#if ($mdb.messageSelector || $mdb.subscriptionDurability),#end +// #end #if ($mdb.messageSelector) - * @javax.ejb.ActivationConfigProperty(propertyName="messageSelector", propertyValue="${mdb.messageSelector}")#if ($mdb.subscriptionDurability),#end - * +// @javax.ejb.ActivationConfigProperty(propertyName="messageSelector", propertyValue="${mdb.messageSelector}")#if ($mdb.subscriptionDurability),#end +// #end #if ($mdb.subscriptionDurability) - * @javax.ejb.ActivationConfigProperty(propertyName="subscriptionDurability", propertyValue="${mdb.subscriptionDurability}") +// @javax.ejb.ActivationConfigProperty(propertyName="subscriptionDurability", propertyValue="${mdb.subscriptionDurability}") #end - *} - *) - */ -#if ($mdb.listenerEnabled) -...@ja...llbackListener(${mdb.fullyQualifiedMessageDrivenListenerName}.class) +//} +//) + +#set ($interceptors = $mdb.interceptorReferences) +#if ($collectionUtils.size($interceptors) >= 1 || $mdb.listenerEnabled) +#**##if ($mdb.listenerEnabled) +#* *##set ($lifecycleCallback = "${mdb.fullyQualifiedMessageDrivenListenerName}.class") +#**##else +#* *##set ($lifecycleCallback = "") +#**##end +// Lifecycle callback listeners and interceptors are defined in ejb-jar.xml +// javax.ejb.Interceptors({$transform.getInterceptorsAsList(${interceptors}, ${lifecycleCallback})}) +#end +#if ($service.excludeDefaultInterceptors) +// @javax.ejb.ExcludeDefaultInterceptors #end + #if ($mdb.transactionManagement) @javax.ejb.TransactionManagement(javax.ejb.TransactionManagementType.${mdb.transactionManagement}) #end |
From: Vance K. <va...@us...> - 2006-03-09 04:28:29
|
User: vancek Date: 06/03/08 20:28:29 Modified: andromda-ejb3/src/main/resources/templates/ejb3 ejb-jar.xml.vsl Log: added default interceptors, session and message-driven bean class interceptors and method level interceptor definitions with class and default interceptor exclusion support Revision Changes Path 1.8 +86 -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.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- ejb-jar.xml.vsl 13 Feb 2006 15:44:31 -0000 1.7 +++ ejb-jar.xml.vsl 9 Mar 2006 04:28:28 -0000 1.8 @@ -95,6 +95,92 @@ </enterprise-beans> <assembly-descriptor> +#foreach ($interceptor in $interceptors) +## +## Default interceptors +## +#**##if ($interceptor.defaultInterceptor) +#* *##if (!$defaultInterceptorExists) + <interceptor-binding> + <ejb-name>*</ejb-name> +#* *##end + <interceptor-class>${interceptor.fullyQualifiedName}</interceptor-class> +#* *##if (!$defaultInterceptorExists) + </interceptor-binding> +#* *##end +#* *##set ($defaultInterceptorExists = true) +#**##end +#end +#foreach ($service in $services) +## +## Service listener - lifecycle callbacks are defined as an interceptor +## +#**##set ($interceptors = $service.interceptorReferences) +#**##if ($collectionUtils.size($interceptors) >= 1 || $service.listenerEnabled) + <interceptor-binding> + <ejb-name>${service.serviceName}</ejb-name> +#* *##if ($service.listenerEnabled) + <interceptor-class>${service.fullyQualifiedServiceListenerName}</interceptor-class> +#* *##end +#* *##foreach ($interceptor in $interceptors) + <interceptor-class>${interceptor.fullyQualifiedName}</interceptor-class> +#* *##end +#* *##if ($service.excludeDefaultInterceptors) + <exclude-default-interceptors/> +#* *##end + </interceptor-binding> +#**##end +#end +## +## Define method level interceptors for session beans +## +#foreach ($service in $services) +#**##foreach ($operation in $service.businessOperations) +#* *##set ($interceptors = $operation.interceptorReferences) +#* *##if ($collectionUtils.size($interceptors) >= 1) + <interceptor-binding> + <ejb-name>${service.serviceName}</ejb-name> +#* *##foreach ($interceptor in $interceptors) + <interceptor-class>${interceptor.fullyQualifiedName}</interceptor-class> +#* *##end + <method-name>${operation.name}</method-name> +#* *##if (!$operation.arguments.empty) + <method-params> +#* *##foreach ($argument in $operation.arguments) + <method-param>${argument.type.fullyQualifiedName}</method-param> +#* *##end + </method-params> +#* *##end +#* *##if ($operation.excludeClassInterceptors) + <exclude-class-interceptors/> +#* *##end +#* *##if ($operation.excludeDefaultInterceptors) + <exclude-default-interceptors/> +#* *##end + </interceptor-binding> +#* *##end +#**##end +#end +#foreach ($mdb in $mdbs) +## +## Message-driven bean listener - lifecycle callbacks are defined as an interceptor +## +#**##set ($interceptors = $mdb.interceptorReferences) +#**##if ($collectionUtils.size($interceptors) >= 1 || $mdb.listenerEnabled) + <interceptor-binding> + <ejb-name>${mdb.messageDrivenName}</ejb-name> +#* *##if ($mdb.listenerEnabled) + <interceptor-class>${mdb.fullyQualifiedMessageDrivenListenerName}</interceptor-class> +#* *##end +#* *##foreach ($interceptor in $interceptors) + <interceptor-class>${interceptor.fullyQualifiedName}</interceptor-class> +#* *##end +#* *##if ($mdb.excludeDefaultInterceptors) + <exclude-default-interceptors/> +#* *##end + </interceptor-binding> +#**##end +#end </assembly-descriptor> </ejb-jar> \ No newline at end of file |
From: Eric C <ecr...@us...> - 2006-03-08 04:21:55
|
User: ecrutchfield Date: 06/03/07 20:21:54 Added: maven2/plugins .cvsignore Log: Revision Changes Path 1.1 plugins/maven2/plugins/.cvsignore Index: .cvsignore =================================================================== target |
From: Eric C <ecr...@us...> - 2006-03-08 04:20:47
|
User: ecrutchfield Date: 06/03/07 20:20:45 Added: . .cvsignore Log: Revision Changes Path 1.1 plugins/.cvsignore Index: .cvsignore =================================================================== target *.log |
From: Eric C <ecr...@us...> - 2006-03-08 04:19:23
|
User: ecrutchfield Date: 06/03/07 20:19:21 Added: . .cvsignore Log: Revision Changes Path 1.1 cartridges/.cvsignore Index: .cvsignore =================================================================== target *.log |
From: Eric C <ecr...@us...> - 2006-03-08 04:18:56
|
User: ecrutchfield Date: 06/03/07 20:18:54 Added: andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades SpringDependencyLogicImpl.java SpringManageableEntityLogicImpl.java SpringMetafacadeUtils.java SpringCriteriaAttributeLogicImpl.java SpringEntityOperationLogicImpl.java SpringManageableEntityAssociationEndLogicImpl.java SpringEntityLogicImpl.java SpringManageableEntityAttributeLogicImpl.java SpringQueryOperationLogicImpl.java SpringCriteriaSearchLogicImpl.java SpringServiceLogicImpl.java SpringAssociationEndLogicImpl.java SpringGlobals.java SpringServiceOperationLogicImpl.java andromda-nspring/src/site/xdoc index.xml howto1.xml tips.xml howto5.xml howto2.xml howto4.xml howto8.xml howto6.xml howto.xml howto7.xml howto3.xml andromda-nspring/src/main/resources/META-INF/andromda profile.xml metafacades.xml namespace.xml cartridge.xml andromda-nspring/src/site/xdoc/resources/howto HowToModel.xml.zip HowToPictures.zip andromda-nspring/src/main/uml SpringMetafacadeModel.xml.zip andromda-nspring/src/main/resources/templates/nspring NSpringHibernateDaoBase.vsl NSpringHibernateDaoImplManual.vsl NSpringGlobals.vm NSpringDaoInterface.vsl NSpringHibernateDaoImpl.vsl NSpringDaoFactory.vsl andromda-nspring/src/main/java/org/andromda/cartridges/nspring SpringProfile.java SpringUtils.java SpringHibernateUtils.java andromda-nspring .cvsignore .project pom.xml .classpath andromda-nspring/conf/test andromda.xml andromda-nspring/src/test/mappings MergeMappings.xml andromda-nspring/src/test/expected cartridge-output.zip andromda-nspring/src/site site.xml andromda-nspring/src/test/uml SpringCartridgeTestModel.xml.zip andromda-nspring/conf/howto andromda.xml Log: add nspring cartridge Revision Changes Path 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringDependencyLogicImpl.java Index: SpringDependencyLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.ModelElementFacade; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.nspring.metafacades.SpringDependency. * * @see org.andromda.cartridges.nspring.metafacades.SpringDependency */ public class SpringDependencyLogicImpl extends SpringDependencyLogic { public SpringDependencyLogicImpl(Object metaObject, String context) { super(metaObject, context); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getTransformationConstantName() */ protected String handleGetTransformationConstantName() { return SpringGlobals.TRANSFORMATION_CONSTANT_PREFIX + this.getName().toUpperCase(); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getTransformationMethodName() */ protected String handleGetTransformationMethodName() { return SpringGlobals.TRANSFORMATION_METHOD_PREFIX + StringUtils.capitalize(this.getName()); } /** * The suffix for the transformation annonymous name. */ private static final String TRANSFORMATION_ANONYMOUS_NAME_SUFFIX = "_TRANSFORMER"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getTransformationAnonymousName() */ protected String handleGetTransformationAnonymousName() { return this.getName().toUpperCase() + TRANSFORMATION_ANONYMOUS_NAME_SUFFIX; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#isCircularReference() */ protected boolean handleIsCircularReference() { boolean circularReference = false; final ModelElementFacade sourceElement = this.getSourceElement(); final ModelElementFacade targetElement = this.getTargetElement(); final Collection sourceDependencies = targetElement.getSourceDependencies(); if (sourceDependencies != null && !sourceDependencies.isEmpty()) { circularReference = CollectionUtils.find(sourceDependencies, new Predicate() { public boolean evaluate(Object object) { DependencyFacade dependency = (DependencyFacade)object; return dependency != null && dependency.getTargetElement().equals(sourceElement); } }) != null; } return circularReference; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getTransformationConstantValue() */ protected int handleGetTransformationConstantValue() { int value = 0; ModelElementFacade element = this.getSourceElement(); if (element instanceof SpringEntity) { final List hierarchy = new ArrayList(); for (SpringEntity entity = (SpringEntity)element; entity != null; entity = (SpringEntity)entity.getGeneralization()) { hierarchy.add(entity); } boolean breakOut = false; for (int ctr = hierarchy.size() - 1; ctr >= 0; ctr--) { final SpringEntity generalization = (SpringEntity)hierarchy.get(ctr); for (final Iterator referenceIterator = generalization.getValueObjectReferences().iterator(); referenceIterator.hasNext();) { final Object reference = referenceIterator.next(); value++; if (reference.equals(this)) { breakOut = true; break; } } if (breakOut) { break; } } } return value; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getTransformationToListMethodName() */ protected String handleGetTransformationToListMethodName() { return SpringGlobals.TRANSFORMATION_METHOD_PREFIX + StringUtils.capitalize(this.getName()) + SpringGlobals.TRANSFORMATION_TO_LIST_METHOD_SUFFIX; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getDaoName() */ protected String handleGetDaoName() { return this.getDaoNamePattern().replaceAll("\\{0\\}", this.getName()); } /** * Gets the value of the {@link SpringGlobals#DAO_PATTERN}. * * @return the DAO name pattern. */ private String getDaoNamePattern() { return String.valueOf(this.getConfiguredProperty(SpringGlobals.DAO_PATTERN)); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getDaoGetterName() */ protected String handleGetDaoGetterName() { return "get" + StringUtils.capitalize(this.getDaoName()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getDaoSetterName() */ protected String handleGetDaoSetterName() { return "set" + StringUtils.capitalize(this.getDaoName()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getTransformationToEntityListMethodName() */ protected String handleGetTransformationToEntityListMethodName() { return this.getTransformationToEntityMethodName() + SpringGlobals.TRANSFORMATION_TO_LIST_METHOD_SUFFIX; } /** * The suffix for the transformation to entity method name. */ private static final String TRANSFORMATION_TO_ENTITY_METHOD_NAME_SUFFIX = "ToEntity"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getTransformationToEntityMethodName() */ protected String handleGetTransformationToEntityMethodName() { return StringUtils.capitalize(this.getName()) + TRANSFORMATION_TO_ENTITY_METHOD_NAME_SUFFIX; } /** * The suffix for the value object to entity transformer. */ private static final String VALUE_OBJECT_TO_ENTITY_TRANSFORMER_SUFFIX = "Transformer"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringDependency#getValueObjectToEntityTransformerName() */ protected String handleGetValueObjectToEntityTransformerName() { return StringUtils.capitalize(this.getTransformationToEntityMethodName()) + VALUE_OBJECT_TO_ENTITY_TRANSFORMER_SUFFIX; } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringManageableEntityLogicImpl.java Index: SpringManageableEntityLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import org.andromda.metafacades.uml.UMLMetafacadeProperties; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.nspring.metafacades.SpringManageableEntity. * * @see org.andromda.cartridges.nspring.metafacades.SpringManageableEntity */ public class SpringManageableEntityLogicImpl extends SpringManageableEntityLogic { public SpringManageableEntityLogicImpl (Object metaObject, String context) { super (metaObject, context); } /** * @return the configured property denoting the character sequence to use for the separation of namespaces */ private String getNamespaceProperty() { return (String)getConfiguredProperty(UMLMetafacadeProperties.NAMESPACE_SEPARATOR); } protected java.lang.String handleGetDaoReferenceName() { final char[] name = getName().toCharArray(); if (name.length > 0) { name[0] = Character.toLowerCase(name[0]); } return new String(name) + "Dao"; } protected java.lang.String handleGetManageableDaoName() { return getName() + "ManageableDao"; } protected java.lang.String handleGetFullyQualifiedManageableDaoName() { return getManageablePackageName() + getNamespaceProperty() + getManageableDaoName(); } protected String handleGetManageableDaoFullPath() { return StringUtils.replace(this.getFullyQualifiedManageableDaoName(), getNamespaceProperty(), "/"); } protected String handleGetManageableDaoBaseName() { return getManageableDaoName() + "Base"; } protected String handleGetFullyQualifiedManageableDaoBaseName() { return getManageablePackageName() + getNamespaceProperty() + getManageableDaoBaseName(); } protected String handleGetManageableDaoBaseFullPath() { return StringUtils.replace(this.getFullyQualifiedManageableDaoBaseName(), this.getNamespaceProperty(), "/"); } protected String handleGetManageableServiceBaseName() { return getManageableServiceName() + "Base"; } protected String handleGetFullyQualifiedManageableServiceBaseName() { return getManageablePackageName() + getNamespaceProperty() + getManageableServiceBaseName(); } protected String handleGetManageableServiceBaseFullPath() { return StringUtils.replace(this.getFullyQualifiedManageableServiceBaseName(), this.getNamespaceProperty(), "/"); } protected String handleGetManageableValueObjectFullPath() { return StringUtils.replace(this.getFullyQualifiedManageableValueObjectName(), this.getNamespaceProperty(), "/"); } protected String handleGetManageableValueObjectClassName() { return getName() + "ValueObject"; } protected String handleGetFullyQualifiedManageableValueObjectName() { return getManageablePackageName() + getNamespaceProperty() + getManageableValueObjectClassName(); } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringMetafacadeUtils.java Index: SpringMetafacadeUtils.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import org.andromda.cartridges.nspring.SpringProfile; import org.andromda.core.common.ExceptionUtils; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.ModelElementFacade; import org.andromda.metafacades.uml.UMLProfile; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.apache.commons.lang.StringUtils; /** * Contains utilities specific to dealing with the Spring cartridge metafacades. * * @author Chad Brandon * @author Peter Friese */ class SpringMetafacadeUtils { /** * Creates a fully qualified name from the given <code>packageName</code>, <code>name</code>, and * <code>suffix</code>. * * @param packageName the name of the model element package. * @param name the name of the model element. * @param suffix the suffix to append. * @return the new fully qualified name. */ static String getFullyQualifiedName(String packageName, String name, String suffix) { StringBuffer fullyQualifiedName = new StringBuffer(StringUtils.trimToEmpty(packageName)); if (StringUtils.isNotBlank(packageName)) { fullyQualifiedName.append("."); } fullyQualifiedName.append(StringUtils.trimToEmpty(name)); if (StringUtils.isNotEmpty(suffix)) { fullyQualifiedName.append(StringUtils.trimToEmpty(suffix)); } return fullyQualifiedName.toString(); } /** * Creates a fully qualified name from the given <code>packageName</code>, <code>name</code>, and * <code>suffix</code>. * * @param packageName the name of the model element package. * @param name the name of the model element. * @return the new fully qualified name. */ static String getFullyQualifiedName(String packageName, String name) { return getFullyQualifiedName(packageName, name, null); } /** * Gets the remoting type for the passed in <code>classifier</code>. If the remoting type can be retrieved from the * <code>classifier</code>, then that is used, otherwise the <code>defaultRemotingType</code> is returned. * * @return String the remoting type name. */ static String getServiceRemotingType(ClassifierFacade classifier, String defaultServiceRemotingType) { final String methodName = "SpringMetafacadeUtils.getServiceRemotingType"; ExceptionUtils.checkNull(methodName, "classifer", classifier); String remotingType = null; if (classifier.hasStereotype(UMLProfile.STEREOTYPE_SERVICE)) { String remotingTypeValue = (String)classifier.findTaggedValue( SpringProfile.TAGGEDVALUE_SPRING_SERVICE_REMOTING_TYPE); // if the remoting type wasn't found, search all super classes if (StringUtils.isEmpty(remotingTypeValue)) { remotingType = (String)CollectionUtils.find(classifier.getAllGeneralizations(), new Predicate() { public boolean evaluate(Object object) { return ((ModelElementFacade)object).findTaggedValue( SpringProfile.TAGGEDVALUE_SPRING_SERVICE_REMOTING_TYPE) != null; } }); } if (StringUtils.isNotEmpty(remotingTypeValue)) { remotingType = remotingTypeValue; } } if (StringUtils.isEmpty(remotingType)) { remotingType = defaultServiceRemotingType; } return remotingType.toLowerCase().trim(); } /** * Get the interceptors for the passed in <code>classifier</code>. If the interceptors can be retrieved from the * <code>classifier</code>, then these will be used, otherwise the <code>defaultInterceptors</code> are * returned. * * @param classifier the classifier whose interceptors we are looking for. * @param defaultInterceptors a list of interceptors to use if the classifier itself has no explicit interceptors. * * @return String[] the interceptors. */ static String[] getServiceInterceptors(ClassifierFacade classifier, String[] defaultInterceptors) { final String methodName = "SpringMetafacadeUtils.getServiceInterceptors"; ExceptionUtils.checkNull(methodName, "classifier", classifier); String[] interceptors = null; if (classifier.hasStereotype(UMLProfile.STEREOTYPE_SERVICE)) { String interceptorsValue = (String)classifier.findTaggedValue( SpringProfile.TAGGEDVALUE_SPRING_SERVICE_INTERCEPTORS); // if the interceptors weren't found, search all super classes if (StringUtils.isEmpty(interceptorsValue)) { interceptorsValue = (String)CollectionUtils.find(classifier.getAllGeneralizations(), new Predicate() { public boolean evaluate(Object object) { return ((ModelElementFacade)object).findTaggedValue( SpringProfile.TAGGEDVALUE_SPRING_SERVICE_INTERCEPTORS) != null; } }); } // interceptors are a comma-separated list of strings, go and split the list if (StringUtils.isNotEmpty(interceptorsValue)) { interceptors = interceptorsValue.split(","); } } if (interceptors == null || interceptors.length == 0) { interceptors = defaultInterceptors; } return interceptors; } /** * Gets the remote service port for the passed in <code>classifier</code>. If the remote service * port can be retrieved from the <code>classifier</code>, then that is used, otherwise the * <code>defaultRemoteServicePort</code> is returned. * * @return String the remote service port. */ static String getServiceRemotePort(ClassifierFacade classifier, String defaultRemoteServicePort) { final String methodName = "SpringMetafacadeUtils.getRemoteServicePort"; ExceptionUtils.checkNull(methodName, "classifer", classifier); String remoteServicePort = null; if (classifier.hasStereotype(UMLProfile.STEREOTYPE_SERVICE)) { String remoteServicePortValue = (String)classifier.findTaggedValue( SpringProfile.TAGGEDVALUE_SPRING_SERVICE_REMOTE_PORT); // if the remote service port wasn't found, search all super classes if (StringUtils.isEmpty(remoteServicePortValue)) { remoteServicePort = (String)CollectionUtils.find(classifier.getAllGeneralizations(), new Predicate() { public boolean evaluate(Object object) { return ((ModelElementFacade)object).findTaggedValue( SpringProfile.TAGGEDVALUE_SPRING_SERVICE_REMOTE_PORT) != null; } }); } if (StringUtils.isNotEmpty(remoteServicePortValue)) { remoteServicePort = remoteServicePortValue; } } if (StringUtils.isEmpty(remoteServicePort)) { remoteServicePort = defaultRemoteServicePort; } return remoteServicePort.toLowerCase().trim(); } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringCriteriaAttributeLogicImpl.java Index: SpringCriteriaAttributeLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import org.andromda.cartridges.nspring.SpringProfile; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttribute. * * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttribute */ public class SpringCriteriaAttributeLogicImpl extends SpringCriteriaAttributeLogic { public SpringCriteriaAttributeLogicImpl( Object metaObject, String context) { super(metaObject, context); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttribute#getAttributeName() */ protected java.lang.String handleGetAttributeName() { // use the attribute name by default String attributeName = getName(); // if there is a tagged value, use it instead Object value = findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_CRITERIA_ATTRIBUTE); if (value != null) { attributeName = String.valueOf(value); } return StringUtils.trimToEmpty(attributeName); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttribute#getComparator() */ protected java.lang.String handleGetComparator() { String comparator = null; Object value = findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_CRITERIA_COMPARATOR); if (value != null) { comparator = String.valueOf(value); } return StringUtils.trimToEmpty(comparator); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttribute#isComparatorPresent() */ protected boolean handleIsComparatorPresent() { return !StringUtils.isEmpty(getComparator()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttribute#getComparatorConstant() */ protected String handleGetComparatorConstant() { String comparator = getComparator(); String comparatorConstant = null; if (comparator != null) { if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_LIKE.equalsIgnoreCase(comparator)) { comparatorConstant = "LIKE_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_INSENSITIVE_LIKE_COMPARATOR.equalsIgnoreCase(comparator)) { comparatorConstant = "INSENSITIVE_LIKE_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_EQUAL.equalsIgnoreCase(comparator)) { comparatorConstant = "EQUAL_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_GREATER_OR_EQUAL.equalsIgnoreCase(comparator)) { comparatorConstant = "GREATER_THAN_OR_EQUAL_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_GREATER.equalsIgnoreCase(comparator)) { comparatorConstant = "GREATER_THAN_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_LESS_OR_EQUAL.equalsIgnoreCase(comparator)) { comparatorConstant = "LESS_THAN_OR_EQUAL_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_LESS.equalsIgnoreCase(comparator)) { comparatorConstant = "LESS_THAN_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_IN.equalsIgnoreCase(comparator)) { comparatorConstant = "IN_COMPARATOR"; } else if (SpringProfile.TAGGEDVALUEVALUE_COMPARATOR_NOT_EQUAL.equalsIgnoreCase(comparator)) { comparatorConstant = "NOT_EQUAL_COMPARATOR"; } } return comparatorConstant; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#handleIsNullable() */ protected boolean handleIsNullable() { boolean result = false; String value = StringUtils.trimToEmpty((String)findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_CRITERIA_NULLABLE)); if (!StringUtils.isEmpty(value)) { result = BooleanUtils.toBoolean(value); } return result; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#handleGetMatchMode() */ protected String handleGetMatchMode() { String matchMode = null; Object value = findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_CRITERIA_MATCHMODE); if (value != null) { matchMode = String.valueOf(value); } String result = StringUtils.trimToEmpty(matchMode); return result; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#handleGetMatchModeConstant() */ protected String handleGetMatchModeConstant() { String matchMode = getMatchMode(); String matchModeConstant = null; if (matchMode != null) { if (matchMode.equals(SpringProfile.TAGGEDVALUEVALUE_MATCHMODE_ANYWHERE)) { matchModeConstant = "ANYWHERE"; } else if (matchMode.equals(SpringProfile.TAGGEDVALUEVALUE_MATCHMODE_END)) { matchModeConstant = "END"; } else if (matchMode.equals(SpringProfile.TAGGEDVALUEVALUE_MATCHMODE_EXACT)) { matchModeConstant = "EXACT"; } else if (matchMode.equals(SpringProfile.TAGGEDVALUEVALUE_MATCHMODE_START)) { matchModeConstant = "START"; } } return matchModeConstant; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#handleIsMatchModePresent() */ protected boolean handleIsMatchModePresent() { return !StringUtils.isEmpty(getMatchMode()); } private static final String ORDER_UNSET = "ORDER_UNSET"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#handleIsOrderable() */ protected boolean handleIsOrderable() { return !ORDER_UNSET.equals(getOrderDirection()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#handleGetOrderDirection() */ protected String handleGetOrderDirection() { String result = ORDER_UNSET; String value = StringUtils.trimToEmpty( (String)findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_CRITERIA_ORDER_DIRECTION)); if (!StringUtils.isEmpty(value)) { if (value.equals(SpringProfile.TAGGEDVALUEVALUE_ORDER_ASCENDING)) { result = "ORDER_ASC"; } else if (value.equals(SpringProfile.TAGGEDVALUEVALUE_ORDER_DESCENDING)) { result = "ORDER_DESC"; } } return result; } /** * Used for undefined states of the criteria ordering. */ private static final int UNSET = -1; /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#handleGetOrderRelevance() */ protected int handleGetOrderRelevance() { int result = UNSET; String value = StringUtils.trimToEmpty( (String)findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_CRITERIA_ORDER_RELEVANCE)); if (!StringUtils.isEmpty(value)) { result = Integer.parseInt(value); } return result; } /** * The default value for whether hibernate criteria arguments are case insensitive or not. */ private static final String HIBERNATE_CRITERIA_QUERY_IGNORE_CASE = "hibernateCriteriaQueryIgnoreCase"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringCriteriaAttributeLogic#isIgnoreCase() */ protected boolean handleIsIgnoreCase() { Object value = this.findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_CRITERIA_COMPARATOR_IGNORE_CASE); if (value == null) { value = this.getConfiguredProperty(HIBERNATE_CRITERIA_QUERY_IGNORE_CASE); } return Boolean.valueOf(ObjectUtils.toString(value)).booleanValue(); } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringEntityOperationLogicImpl.java Index: SpringEntityOperationLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.nspring.metafacades.SpringEntityOperation. * * @see org.andromda.cartridges.nspring.metafacades.SpringEntityOperation */ public class SpringEntityOperationLogicImpl extends SpringEntityOperationLogic { public SpringEntityOperationLogicImpl(Object metaObject, String context) { super(metaObject, context); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntityOperation#getImplementationName() */ protected java.lang.String handleGetImplementationName() { return this.getImplementationOperationName(StringUtils.capitalize(this.getName())); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntityOperation#getImplementationCall() */ protected java.lang.String handleGetImplementationCall() { return this.getImplementationOperationName(StringUtils.capitalize(this.getCall())); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntityOperation#getImplementationSignature() */ protected java.lang.String handleGetImplementationSignature() { return this.getImplementationOperationName(StringUtils.capitalize(this.getSignature())); } /** * Retrieves the implementationOperatName by replacing the <code>replacement</code> in the {@link * SpringGlobals#IMPLEMENTATION_OPERATION_NAME_PATTERN} * * @param replacement the replacement string for the pattern. * @return the operation name */ private String getImplementationOperationName(String replacement) { return StringUtils.trimToEmpty(String.valueOf(this.getConfiguredProperty( SpringGlobals.IMPLEMENTATION_OPERATION_NAME_PATTERN))).replaceAll("\\{0\\}", replacement); } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringManageableEntityAssociationEndLogicImpl.java Index: SpringManageableEntityAssociationEndLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.utils.StringUtilsHelper; /** * MetafacadeLogic implementation for org.andromda.cartridges.nspring.metafacades.SpringManageableEntityAssociationEnd. * * @see org.andromda.cartridges.nspring.metafacades.SpringManageableEntityAssociationEnd */ public class SpringManageableEntityAssociationEndLogicImpl extends SpringManageableEntityAssociationEndLogic { public SpringManageableEntityAssociationEndLogicImpl (Object metaObject, String context) { super (metaObject, context); } protected java.lang.String handleGetDaoName() { return StringUtilsHelper.lowerCamelCaseName(this.getName()) + "Dao"; } protected java.lang.String handleGetDaoReferenceName() { String referenceName = null; final ClassifierFacade type = this.getType(); if (type instanceof SpringManageableEntity) { final SpringManageableEntity entity = (SpringManageableEntity)type; referenceName = entity.getBeanName(false); } return referenceName; } protected java.lang.String handleGetDaoGetterName() { return this.getGetterName() + "Dao"; } protected java.lang.String handleGetDaoSetterName() { return this.getSetterName() + "Dao"; } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringEntityLogicImpl.java Index: SpringEntityLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import org.andromda.cartridges.nspring.SpringProfile; import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.DependencyFacade; import org.andromda.metafacades.uml.EnumerationFacade; import org.andromda.metafacades.uml.FilteredCollection; import org.andromda.metafacades.uml.GeneralizableElementFacade; import org.andromda.metafacades.uml.OperationFacade; import org.andromda.metafacades.uml.UMLProfile; import org.andromda.metafacades.uml.ValueObject; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for org.andromda.cartridges.nspring.metafacades.SpringEntity. * * @see org.andromda.cartridges.nspring.metafacades.SpringEntity */ public class SpringEntityLogicImpl extends SpringEntityLogic { public SpringEntityLogicImpl( Object metaObject, String context) { super(metaObject, context); } /** * Value for one Table per root class */ private static final String INHERITANCE_STRATEGY_CLASS = "class"; /** * Value for joined-subclass */ private static final String INHERITANCE_STRATEGY_SUBCLASS = "subclass"; /** * Value for one Table per concrete class */ private static final String INHERITANCE_STRATEGY_CONCRETE = "concrete"; /** * Value make Entity an interface, delegate attributes to subclasses. */ private static final String INHERITANCE_STRATEGY_INTERFACE = "interface"; /** * Stores the valid inheritance strategies. */ private static final Collection inheritanceStrategies = new ArrayList(); static { inheritanceStrategies.add(INHERITANCE_STRATEGY_CLASS); inheritanceStrategies.add(INHERITANCE_STRATEGY_SUBCLASS); inheritanceStrategies.add(INHERITANCE_STRATEGY_CONCRETE); inheritanceStrategies.add(INHERITANCE_STRATEGY_INTERFACE); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getDaoName() */ protected java.lang.String handleGetDaoName() { return this.getDaoNamePattern().replaceAll( "\\{0\\}", this.getName()); } /** * Gets the value of the {@link SpringGlobals#DAO_PATTERN} * * @return the DAO name pattern. */ private String getDaoNamePattern() { return String.valueOf(this.getConfiguredProperty(SpringGlobals.DAO_PATTERN)); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getFullyQualifiedDaoName() */ protected java.lang.String handleGetFullyQualifiedDaoName() { return SpringMetafacadeUtils.getFullyQualifiedName( this.getPackageName(), this.getDaoName()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getDaoImplementationName() */ protected java.lang.String handleGetDaoImplementationName() { return this.getDaoImplementationNamePattern().replaceAll( "\\{0\\}", this.getName()); } /** * Gets the value of the {@link SpringGlobals#DAO_IMPLEMENTATION_PATTERN} * * @return the DAO implementation name pattern. */ private String getDaoImplementationNamePattern() { return String.valueOf(this.getConfiguredProperty(SpringGlobals.DAO_IMPLEMENTATION_PATTERN)); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getFullyQualifiedDaoImplementationName() */ protected java.lang.String handleGetFullyQualifiedDaoImplementationName() { return SpringMetafacadeUtils.getFullyQualifiedName( this.getPackageName(), this.getDaoImplementationName()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getDaoBaseName() */ protected java.lang.String handleGetDaoBaseName() { return this.getDaoBaseNamePattern().replaceAll( "\\{0\\}", this.getName()); } /** * Gets the value of the {@link SpringGlobals#DAO_BASE_PATTERN} * * @return the DAO base name pattern. */ private String getDaoBaseNamePattern() { return String.valueOf(this.getConfiguredProperty(SpringGlobals.DAO_BASE_PATTERN)); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getFullyQualifiedDaoBaseName() */ protected java.lang.String handleGetFullyQualifiedDaoBaseName() { return SpringMetafacadeUtils.getFullyQualifiedName( this.getPackageName(), this.getDaoBaseName()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getImplementationName() */ protected java.lang.String handleGetEntityImplementationName() { return this.getEntityName() + SpringGlobals.IMPLEMENTATION_SUFFIX; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getFullyQualifiedEntityImplementationName() */ protected java.lang.String handleGetFullyQualifiedEntityImplementationName() { return SpringMetafacadeUtils.getFullyQualifiedName( this.getPackageName(), this.getEntityName(), SpringGlobals.IMPLEMENTATION_SUFFIX); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getBeanName(boolean) */ protected java.lang.String handleGetBeanName(boolean targetSuffix) { final String beanName = StringUtils.uncapitalize(StringUtils.trimToEmpty(this.getName())); final StringBuffer beanNameBuffer = new StringBuffer(this.getDaoNamePattern().replaceAll("\\{0\\}", beanName)); if (targetSuffix) { beanNameBuffer.append(SpringGlobals.BEAN_NAME_TARGET_SUFFIX); } return beanNameBuffer.toString(); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getEntityName() */ protected String handleGetEntityName() { final String entityNamePattern = (String)this.getConfiguredProperty("entityNamePattern"); return MessageFormat.format( entityNamePattern, new Object[] {StringUtils.trimToEmpty(this.getName())}); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getFullyQualifiedEntityName() */ protected String handleGetFullyQualifiedEntityName() { return SpringMetafacadeUtils.getFullyQualifiedName( this.getPackageName(), this.getEntityName(), null); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getRoot() */ protected Object handleGetRoot() { GeneralizableElementFacade generalization = this; for ( ; generalization.getGeneralization() != null && generalization instanceof SpringEntity; generalization = generalization.getGeneralization()) ; return generalization; } /** * The namespace property storing the hibernate default-cascade value for an entity. */ private static final String HIBERNATE_DEFAULT_CASCADE = "hibernateDefaultCascade"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getHibernateDefaultCascade() */ protected String handleGetHibernateDefaultCascade() { return StringUtils.trimToEmpty(String.valueOf(this.getConfiguredProperty(HIBERNATE_DEFAULT_CASCADE))); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#isDaoBusinessOperationsPresent() */ protected boolean handleIsDaoBusinessOperationsPresent() { return this.getDaoBusinessOperations() != null && !this.getDaoBusinessOperations().isEmpty(); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getDaoBusinessOperations() */ protected Collection handleGetDaoBusinessOperations() { // operations that are not finders and static Collection finders = this.getQueryOperations(); Collection operations = this.getOperations(); Collection nonFinders = CollectionUtils.subtract(operations, finders); return new FilteredCollection(nonFinders) { public boolean evaluate(Object object) { return ((OperationFacade)object).isStatic(); } }; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getValueObjectReferences() */ protected Collection handleGetValueObjectReferences() { return this.getValueObjectReferences(false); } /** * Retrieves the values object references for this entity. If * <code>follow</code> is true, then all value object references * (including those that were inherited) will be retrieved. */ protected Collection getValueObjectReferences(boolean follow) { final Collection sourceDependencies = new ArrayList(this.getSourceDependencies()); if (follow) { for ( GeneralizableElementFacade entity = this.getGeneralization(); entity != null; entity = entity.getGeneralization()) { sourceDependencies.addAll(entity.getSourceDependencies()); } } return new FilteredCollection(sourceDependencies) { public boolean evaluate(Object object) { boolean valid = false; Object targetElement = ((DependencyFacade)object).getTargetElement(); if (targetElement instanceof ClassifierFacade) { ClassifierFacade element = (ClassifierFacade)targetElement; valid = element.isDataType() || element instanceof ValueObject || element instanceof EnumerationFacade; } return valid; } }; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getAllValueObjectReferences() */ protected Collection handleGetAllValueObjectReferences() { return this.getValueObjectReferences(true); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#isDaoImplementationRequired() */ protected boolean handleIsDaoImplementationRequired() { return !this.getValueObjectReferences().isEmpty() || !this.getDaoBusinessOperations().isEmpty() || !this.getQueryOperations(true).isEmpty(); } /** * The suffix given to the no transformation constant. */ private static final String NO_TRANSFORMATION_CONSTANT_SUFFIX = "NONE"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getDaoNoTransformationConstantName() */ protected String handleGetDaoNoTransformationConstantName() { return SpringGlobals.TRANSFORMATION_CONSTANT_PREFIX + NO_TRANSFORMATION_CONSTANT_SUFFIX; } /** * Common routine to check inheritance. */ protected boolean checkHibInheritance(String inheritance) { return inheritance.equals(getHibernateInheritanceStrategy()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#isHibernateInheritanceClass() */ protected boolean handleIsHibernateInheritanceClass() { return checkHibInheritance(INHERITANCE_STRATEGY_CLASS); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#isHibernateInheritanceInterface() */ protected boolean handleIsHibernateInheritanceInterface() { return checkHibInheritance(INHERITANCE_STRATEGY_INTERFACE); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#isHibernateInheritanceSubclass() */ protected boolean handleIsHibernateInheritanceSubclass() { return checkHibInheritance(INHERITANCE_STRATEGY_SUBCLASS); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#isHibernateInheritanceConcrete() */ protected boolean handleIsHibernateInheritanceConcrete() { return checkHibInheritance(INHERITANCE_STRATEGY_CONCRETE); } /** * Stores the default hibernate inheritance strategy. */ private static final String INHERITANCE_STRATEGY = "hibernateInheritanceStrategy"; /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getHibernateInheritanceStrategy() */ protected String handleGetHibernateInheritanceStrategy() { String inheritance = this.getInheritance(this); for (SpringEntity superEntity = this.getSuperEntity(); superEntity != null && StringUtils.isBlank(inheritance);) { inheritance = superEntity.getHibernateInheritanceStrategy(); } if (StringUtils.isBlank(inheritance) || !inheritanceStrategies.contains(inheritance)) { inheritance = this.getDefaultInheritanceStrategy(); } return inheritance; } /** * Gets the default hibernate inhertance strategy. * * @return the default hibernate inheritance strategy. */ private String getDefaultInheritanceStrategy() { return String.valueOf(this.getConfiguredProperty(INHERITANCE_STRATEGY)); } /** * Return the inheritance tagged value for for given <code>entity</code>. * * @param the SpringEntity from which to retrieve the inheritance tagged value. * @return String inheritance tagged value. */ private String getInheritance(SpringEntity entity) { String inheritance = null; if (entity != null) { Object value = entity.findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_INHERITANCE); if (value != null) { inheritance = String.valueOf(value); } } return inheritance; } /** * @see org.andromda.cartridges.hibernate.metafacades.SpringEntity#isRequiresHibernateMapping() */ protected boolean handleIsRequiresHibernateMapping() { final SpringEntity superEntity = this.getSuperEntity(); return this.isRoot() && ( !this.isHibernateInheritanceInterface() || this.getSpecializations().isEmpty() || (superEntity != null && superEntity.isHibernateInheritanceInterface()) ); } /** * Indicates if this entity as a <code>root</code> entity (meaning it doesn't specialize anything). */ private boolean isRoot() { final SpringEntity superEntity = this.getSuperEntity(); boolean abstractConcreteEntity = (this.isHibernateInheritanceConcrete() || this.isHibernateInheritanceInterface()) && this.isAbstract(); return ( this.getSuperEntity() == null || (superEntity.isHibernateInheritanceInterface() || superEntity.isHibernateInheritanceConcrete()) ) && !abstractConcreteEntity; } /** * Gets the super entity for this entity (if one exists). If a generalization does not exist OR if it's not an * instance of SpringEntity then return null. * * @return the super entity or null if one doesn't exist. */ private SpringEntity getSuperEntity() { SpringEntity superEntity = null; if (this.getGeneralization() != null && this.getGeneralization() instanceof SpringEntity) { superEntity = (SpringEntity)this.getGeneralization(); } return superEntity; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringEntity#getAttributeEmbeddedValueList() */ protected String handleGetAttributeEmbeddedValueList() { final Collection embeddedValues = new ArrayList(); for (final Iterator iterator = this.getAttributes().iterator(); iterator.hasNext();) { final AttributeFacade attribute = (AttributeFacade)iterator.next(); final ClassifierFacade type = attribute.getType(); if (type != null && type.hasStereotype(UMLProfile.STEREOTYPE_EMBEDDED_VALUE)) { embeddedValues.add(attribute.getName()); } } final StringBuffer buffer = new StringBuffer(); for (final Iterator iterator = embeddedValues.iterator(); iterator.hasNext();) { final String name = (String)iterator.next(); if (StringUtils.isNotBlank(name)) { buffer.append('\"' + name + '\"'); if (iterator.hasNext()) { buffer.append(", "); } } } return buffer.toString(); } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringManageableEntityAttributeLogicImpl.java Index: SpringManageableEntityAttributeLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; /** * MetafacadeLogic implementation for org.andromda.cartridges.nspring.metafacades.SpringManageableEntityAttribute. * * @see org.andromda.cartridges.nspring.metafacades.SpringManageableEntityAttribute */ public class SpringManageableEntityAttributeLogicImpl extends SpringManageableEntityAttributeLogic { public SpringManageableEntityAttributeLogicImpl (Object metaObject, String context) { super (metaObject, context); } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringQueryOperationLogicImpl.java Index: SpringQueryOperationLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; import java.util.Collection; import java.util.Iterator; import org.andromda.cartridges.nspring.SpringProfile; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.ParameterFacade; import org.andromda.metafacades.uml.UMLProfile; import org.andromda.utils.StringUtilsHelper; import org.apache.commons.lang.StringUtils; /** * @see org.andromda.cartridges.hibernate.metafacades.SpringQueryOperation Metaclass facade implementation. */ public class SpringQueryOperationLogicImpl extends SpringQueryOperationLogic { public SpringQueryOperationLogicImpl(Object metaObject, String context) { super(metaObject, context); } /** * @see org.andromda.cartridges.nspring.metafacades.HibernateFinderMethod#getQuery() */ protected String handleGetQuery() { return this.getQuery((SpringEntity)null); } /** * Stores the translated query so that its only translated once. */ private String translatedQuery = null; /** * Retrieves the translated query. */ private String getTranslatedQuery() { if (this.translatedQuery == null) { this.translatedQuery = super.getQuery("query.Hibernate-QL"); } return this.translatedQuery; } /** * Stores whether or not named parameters should be used in hibernate queries. */ private static final String USE_NAMED_PARAMETERS = "hibernateQueryUseNamedParameters"; /** * @see org.andromda.cartridges.nspring.metafacades.HibernateFinderMethod#isUseNamedParameters() */ protected boolean handleIsUseNamedParameters() { return Boolean.valueOf(String.valueOf(this.getConfiguredProperty(USE_NAMED_PARAMETERS))).booleanValue() || StringUtils.isNotBlank( this.getTranslatedQuery()); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringQueryOperation#isCriteriaFinder() */ protected boolean handleIsCriteriaFinder() { return (getCriteriaArgument() != null); } /** * @see org.andromda.cartridges.nspring.metafacades.SpringQueryOperation#getCriteriaArgument() */ protected ParameterFacade handleGetCriteriaArgument() { Collection parameters = getParameters(); for (final Iterator iter = parameters.iterator(); iter.hasNext();) { ParameterFacade parameter = (ParameterFacade)iter.next(); ClassifierFacade type = parameter.getType(); if (type.hasStereotype(UMLProfile.STEREOTYPE_CRITERIA)) { return parameter; } } return null; } /** * @see org.andromda.cartridges.nspring.metafacades.SpringQueryOperation#getQuery(org.andromda.cartridges.nspring.metafacades.SpringEntity) */ protected String handleGetQuery(SpringEntity entity) { // first see if we can retrieve the query from the super class as an OCL // translation String queryString = this.getTranslatedQuery(); // otherwise see if there is a query stored as a tagged value if (StringUtils.isEmpty(queryString)) { Object value = this.findTaggedValue(SpringProfile.TAGGEDVALUE_HIBERNATE_QUERY); queryString = (String)value; if (queryString != null) { // remove any excess whitespace queryString = queryString.replaceAll("[$\\s]+", " "); } } // if there wasn't any stored query, create one by default. if (StringUtils.isEmpty(queryString)) { SpringEntity owner; if (entity == null) { owner = (SpringEntity)this.getOwner(); } else { owner = entity; } String variableName = StringUtils.uncapitalize(owner.getName()); queryString = "from " + owner.getFullyQualifiedEntityImplementationName() + " as " + variableName; if (this.getArguments().size() > 0) { queryString = queryString + " where"; Collection arguments = this.getArguments(); if (arguments != null && !arguments.isEmpty()) { Iterator argumentIt = arguments.iterator(); for (int ctr = 0; argumentIt.hasNext(); ctr++) { ParameterFacade argument = (ParameterFacade)argumentIt.next(); String parameter = "?"; if (this.isUseNamedParameters()) { parameter = ":" + argument.getName(); } queryString = queryString + " " + variableName + "." + StringUtilsHelper.upperCamelCaseName(argument.getName()) + " = " + parameter; if (argumentIt.hasNext()) { queryString = queryString + " and"; } } } } } return queryString; } } 1.1 cartridges/andromda-nspring/src/main/java/org/andromda/cartridges/nspring/metafacades/SpringCriteriaSearchLogicImpl.java Index: SpringCriteriaSearchLogicImpl.java =================================================================== package org.andromda.cartridges.nspring.metafacades; /*... [truncated message content] |
From: Eric C <ecr...@us...> - 2006-03-08 04:16:00
|
User: ecrutchfield Date: 06/03/07 20:15:59 Added: andromda-nhibernate/src/main/resources/templates/nhibernate nhibernate.hbm.xml.vsl NHibernateEmbeddedValueImpl.vsl NHibernateEmbeddedValue.vsl NHibernateEnumeration.vsl NHibernateEntityImplManual.vsl NHibernateEntity.vsl NHibernateEntityImpl.vsl nhibernate.cfg.xml.vsl nhibernate.cs.vm nhibernate.hbm.xml.vm andromda-nhibernate/src/main/java/org/andromda/cartridges/nhibernate/metafacades HibernateFinderMethodArgumentLogicImpl.java HibernateMetafacadeUtils.java HibernateAssociationEndLogicImpl.java HibernateAssociationLogicImpl.java HibernateServiceLogicImpl.java HibernateServiceOperationLogicImpl.java HibernateGlobals.java HibernateTypeLogicImpl.java HibernateFinderMethodLogicImpl.java HibernateEntityAttributeLogicImpl.java HibernateEntityLogicImpl.java HibernateEnumerationLogicImpl.java HibernateEmbeddedValueLogicImpl.java andromda-nhibernate/src/site site.xml andromda-nhibernate/src/main/resources/META-INF/andromda metafacades.xml profile.xml namespace.xml cartridge.xml andromda-nhibernate pom.xml .cvsignore andromda-nhibernate/src/main/uml HibernateMetafacadeModel.xml.zip andromda-nhibernate/src/site/xdoc index.xml howto1.xml andromda-nhibernate/conf/test andromda.xml andromda-nhibernate/src/test/expected cartridge-output.zip andromda-nhibernate/src/test/uml HibernateCartridgeTestModel.xml.zip andromda-nhibernate/src/test/mappings MergeMappings.xml andromda-nhibernate/src/main/java/org/andromda/cartridges/nhibernate HibernateUtils.java HibernateProfile.java Log: add nhibernate cartridge Revision Changes Path 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/nhibernate.hbm.xml.vsl Index: nhibernate.hbm.xml.vsl =================================================================== #parse("templates/nhibernate/nhibernate.hbm.xml.vm") #set ($generatedFile = "${entity.packagePath}/${entity.entityName}.hbm.xml") <?xml version="1.0" encoding="$xmlEncoding"?> <!-- Name: ${entity.entityName}.hbm.xml license-header java merge-point Attention: Generated code! Do not modify by hand! Generated by: nhibernate.hbm.xml.vsl in andromda-nhibernate-cartridge. --> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" default-cascade="$entity.hibernateDefaultCascade"> <class name="$entity.fullyQualifiedEntityImplementationName, ${coreAssemblyName}" table="$entity.tableName" dynamic-insert="$entity.dynamicInsert" dynamic-update="$entity.dynamicUpdate" lazy="$entity.lazy"#if ($entity.hibernateProxy) proxy="$entity.fullyQualifiedEntityImplementationName"#end> #if($hibernateEnableCache.equalsIgnoreCase("true")) <cache usage="$entity.hibernateCacheType" /> #end ## **** Generate <id> **** #if (!$entity.identifiers.empty) #set ($identifier = $entity.identifiers.iterator().next()) #end <id name="${stringUtils.upperCamelCaseName($identifier.name)}" type="$identifier.type.fullyQualifiedHibernateType" unsaved-value="$identifier.type.javaNullString"> <column name="$identifier.columnName" sql-type="$identifier.sqlType"/> <generator class="$entity.hibernateGeneratorClass"> #if ($entity.sequenceHibernateGeneratorClass) <param name="sequence">${entity.tableName}${sequenceIdentifierSuffix}</param> #elseif ($entity.foreignHibernateGeneratorClass) <param name="property">${stringUtils.upperCamelCaseName($entity.parentEnd.name)}</param> #end </generator> </id> ## **** Generate <discriminator> **** #if (!$entity.specializations.empty && $entity.hibernateInheritanceClass) <discriminator column="$entity.hibernateDiscriminatorColumn" type="$entity.hibernateDiscriminatorType"/> #end ## **** Generate <version> **** #if ($stringUtils.isNotBlank($entity.hibernateVersionProperty)) <version name="$entity.hibernateVersionProperty" type="Int32" column="$entity.hibernateVersionProperty"/> #end ## **** If super inheritance is 'interface', render super properties etc **** #foreach ($generalization in $entity.allGeneralizations) #if($generalization.mappingRequiresSuperProperties) #renderPropertiesAndAssociations($generalization "" ) #end #end ## **** render the properties and associations (if any) **** #renderPropertiesAndAssociations($entity "" ) ## **** render the subclass elements if class or subclass strategy. **** #if ($entity.requiresSpecializationMapping) #foreach ($entity in $entity.specializations) #renderSubClass($entity) #end## foreach #end## ($entity.requiresMappingSpecialization) </class> </hibernate-mapping> 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/NHibernateEmbeddedValueImpl.vsl Index: NHibernateEmbeddedValueImpl.vsl =================================================================== #set ($generatedFile = "${embeddedValue.packagePath}/${embeddedValue.implementationName}.cs") // Name: ${embeddedValue.implementationName}.cs // license-header cs merge-point // // This is only generated once! It will never be overwritten. // You can (and have to!) safely modify it by hand. using System; #if ($stringUtils.isNotBlank($embeddedValue.packageName)) namespace $embeddedValue.packageName { #end /// <summary> /// @see $embeddedValue.fullyQualifiedName /// </summary> public#if ($embeddedValue.abstract) abstract#end class $embeddedValue.implementationName : $embeddedValue.fullyQualifiedName { #foreach ($operation in $embeddedValue.operations) /// <summary> /// @see ${embeddedValue.fullyQualifiedName}#${operation.getSignature(false)} /// </summary> $operation.visibility override $operation.returnType.fullyQualifiedName $operation.signature { //TODO: implement $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #if ($operation.returnTypePresent) return $operation.returnType.javaNullString; #else throw new NotImplementedException("${embeddedValue.fullyQualifiedName}.${operation.signature} Not implemented!"); #end } #end } #if ($stringUtils.isNotBlank($embeddedValue.packageName)) } #end 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/NHibernateEmbeddedValue.vsl Index: NHibernateEmbeddedValue.vsl =================================================================== #set ($generatedFile = "${embeddedValue.packagePath}/${embeddedValue.name}.cs") // Name: ${embeddedValue.name}.cs // license-header cs merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: HibernateEmbeddedValue.vsl in andromda-nhibernate-cartridge. using System; #if ($stringUtils.isNotBlank($embeddedValue.packageName)) namespace $embeddedValue.packageName { #end /// <summary> $embeddedValue.getDocumentation(" /// ") /// </summary> public abstract class $embeddedValue.name #if($embeddedValue.generalization) : $embeddedValue.generalization.fullyQualifiedName #end { // ----- Attributes ----- #foreach ($attribute in $embeddedValue.attributes) private $attribute.getterSetterTypeName $attribute.name; #end // ----- Constructors ----- /// <summary> /// Creates a new instance of {@link ${embeddedValue.name}} /// taking all properties. /// </summary> #set ($parenthesis = "(") #if ($embeddedValue.attributes.empty) #set ($parenthesis = "()") #end public static $embeddedValue.name newInstance${parenthesis} #foreach ($attribute in $embeddedValue.attributes) $attribute.getterSetterTypeName ${attribute.name}#if($velocityCount != $embeddedValue.attributes.size()),#else) #end #end { $embeddedValue.implementationName obj = new ${embeddedValue.implementationName}(); #foreach ($attribute in $embeddedValue.attributes) obj.${attribute.name} = ${attribute.name}; #end obj.initialize(); return obj; } /// <summary> /// Creates a new instance from other $embeddedValue.name instance. /// </summary> public static ${embeddedValue.name} newInstance($embeddedValue.name otherObject) { if (otherObject != null) { return newInstance( #foreach ($attribute in $embeddedValue.attributes) otherObject.${attribute.name}#if($velocityCount != $embeddedValue.attributes.size()),#else); #end #end } return null; } protected ${embeddedValue.name}() { } /// <summary> /// Hook for initializing the object in the subclass /// </summary> protected void initialize() { } // ----- Accessors ----- #foreach ($attribute in $embeddedValue.attributes) #set ($typeName = $attribute.getterSetterTypeName) /// <summary> $attribute.getDocumentation(" /// ") #if ($embeddedValue.immutable) /// protected setter, if subclass methods need to normalize the $embeddedValue.name #end /// </summary> #if ($embeddedValue.immutable) public $typeName ${stringUtils.upperCamelCaseName($attribute.name)} { get { return $attribute.name; } } protected void ${attribute.setterName}($attribute.getterSetterTypeName $attribute.name) { this.${attribute.name} = $attribute.name; } #else public $typeName ${stringUtils.upperCamelCaseName($attribute.name)} { get { return $attribute.name; } set { this.$attribute.name = value; } } #end #end #foreach ($operation in $embeddedValue.operations) #set ($returnType = $operation.returnType) #set ($signature = $operation.signature) /// <summary> $operation.getDocumentation(" /// ") /// </summary> $operation.visibility abstract $returnType.fullyQualifiedName $signature; #end /// <summary> /// Indicates if the argument is of the same type and all attributes are equal. /// </summary> #renderEqualsMethod($embeddedValue) /// <summary> /// Returns a hash code based on class attributes. /// </summary> #renderHashCodeMethod($embeddedValue $embeddedValue.attributes) } #if ($stringUtils.isNotBlank($embeddedValue.packageName)) } #end 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/NHibernateEnumeration.vsl Index: NHibernateEnumeration.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: HibernateEnumeration.vsl in andromda-nhibernate-cartridge. // #set ($generatedFile = "${stringUtils.replace($enumeration.packageName, '.', '/')}/${enumeration.enumerationName}.cs") #if ($stringUtils.isNotBlank($enumeration.packageName)) package $enumeration.packageName; #end import ${hibernateUtils.hibernatePackage}.HibernateException; import java.sql.Types; import java.sql.ResultSet; import java.sql.PreparedStatement; import java.sql.SQLException; /** $enumeration.getDocumentation(" * ") */ public final class $enumeration.enumerationName extends $enumeration.name implements java.io.Serializable, java.lang.Comparable, ${hibernateUtils.hibernateUserTypePackage}.UserType { private static final int[] SQL_TYPES = {Types.VARCHAR}; /** * Default constructor. Hibernate needs the default constructor * to retrieve an instance of the enum from a JDBC resultset. * The instance will be converted to the correct enum instance * in {@link #nullSafeGet(java.sql.ResultSet, java.lang.String[], java.lang.Object)}. */ public ${enumeration.enumerationName}() : base() { } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#sqlTypes() */ public int[] sqlTypes() { return SQL_TYPES; } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#deepCopy(java.lang.Object) */ public Object deepCopy(Object value) throws HibernateException { // Enums are immutable - nothing to be done to deeply clone it return value; } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#isMutable() */ public boolean isMutable() { // Enums are immutable return false; } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#equals(java.lang.Object, java.lang.Object) */ public boolean equals(Object x, Object y) throws HibernateException { return (x == y) || (x != null && y != null && y.equals(x)); } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#returnedClass() */ public Class returnedClass() { return ${enumeration.name}.class; } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#nullSafeGet(java.sql.ResultSet, java.lang.String[], java.lang.Object) */ public Object nullSafeGet(ResultSet resultSet, String[] values, Object owner) throws HibernateException, SQLException { #if ($enumeration.literalType.primitive) #set ($valueAssignment = "(($enumeration.literalType.wrapperName)resultSet.getObject(values[0])).${enumeration.literalType.fullyQualifiedName}Value()") #else #set ($valueAssignment = "($enumeration.literalType.fullyQualifiedName)resultSet.getObject(values[0])") #end final $enumeration.literalType.fullyQualifiedName value = $valueAssignment; return resultSet.wasNull() ? null : ${enumeration.fromOperationName}(value); } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#nullSafeSet(java.sql.PreparedStatement, java.lang.Object, int) */ public void nullSafeSet(PreparedStatement statement, Object value, int index) throws HibernateException, SQLException { if (value == null) { statement.setNull(index, Types.VARCHAR); } else { #if ($enumeration.literalType.primitive) #set ($typeName = $enumeration.literalType.wrapperName) #else #set ($typeName = $enumeration.literalType.fullyQualifiedName) #end statement.setObject(index, ${typeName}.valueOf(java.lang.String.valueOf(value))); } } #if ($hibernateVersion == "3") /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#replace(Object original, Object target, Object owner) */ public Object replace(Object original, Object target, Object owner) { return original; } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#assemble(java.io.Serializable cached, Object owner) */ public Object assemble(java.io.Serializable cached, Object owner) { return cached; } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#assemble(Object value) */ public java.io.Serializable disassemble(Object value) { return (java.io.Serializable)value; } /** * @see ${hibernateUtils.hibernateUserTypePackage}.UserType#assemble(Object value) */ public int hashCode(Object x) { return x.hashCode(); } #end } 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/NHibernateEntityImplManual.vsl Index: NHibernateEntityImplManual.vsl =================================================================== #set ($generatedFile = "${entity.packagePath}/${entity.entityImplementationName}.cs") // Name: ${entity.entityImplementationName}.cs // license-header cs merge-point // // This is only generated once! It will never be overwritten. // You can (and have to!) safely modify it by hand. using System; #if ($stringUtils.isNotBlank($entity.packageName)) namespace $entity.packageName { #end /// <summary> /// <see cref="$entity.fullyQualifiedEntityName"/> /// </summary> [Serializable] public#if ($entity.abstract) abstract#end class $entity.entityImplementationName : $entity.fullyQualifiedEntityName { #foreach ($operation in $entity.businessOperations) /// <summary> /// <see cref="${entity.fullyQualifiedEntityName}#${operation.getSignature(false)}"/> /// </summary> #set ($abstract = $entity.abstract && $operation.abstract) $operation.visibility#if ($abstract) abstract#end override $operation.returnType.fullyQualifiedName $operation.signature#if ($abstract && !$operation.exceptionsPresent);#end #if (!$abstract) { //TODO: implement $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #if ($operation.returnTypePresent) return $operation.returnType.javaNullString; #else throw new NotImplementedException("${entity.fullyQualifiedName}.${operation.signature} Not implemented!"); #end } #end #end } #if ($stringUtils.isNotBlank($entity.packageName)) } #end 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/NHibernateEntity.vsl Index: NHibernateEntity.vsl =================================================================== #set ($generatedFile = "${entity.packagePath}/${entity.entityName}.cs") // Name: ${entity.entityName}.cs // license-header cs merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: HibernateEntity.vsl in andromda-nhibernate-cartridge. using System; #if ($stringUtils.isNotBlank($entity.packageName)) namespace $entity.packageName { #end /// <summary> $entity.getDocumentation(" /// ") /// </summary> [Serializable] public abstract class $entity.entityName #if($entity.generalization) : $entity.generalization.fullyQualifiedEntityImplementationName #end { #if ($stringUtils.isNotBlank($entity.hibernateVersionProperty)) #set ($versionProperty = $entity.hibernateVersionProperty) #set ($versionPropertyCapitalized = $stringUtils.capitalize($entity.hibernateVersionProperty)) /// <summary> /// Version property managed by Hibernate. /// </summary> private int $versionProperty; public int get$versionPropertyCapitalized() { return this.$versionProperty; } private void set$versionPropertyCapitalized (int $versionProperty) { this.$versionProperty = $versionProperty; } #end // ----- Attributes and Associations ----- ## **** Generate attribute **** #foreach ( $attribute in $entity.attributes ) #set ($typeName = $attribute.type.fullyQualifiedName) #if ($attribute.containsEmbeddedObject) #set ($typeName = $attribute.type.fullyQualifiedEntityName) #end private $typeName $attribute.name; #end ## **** Generate associations **** #foreach ($associationEnd in $entity.associationEnds) #set ($target = $associationEnd.otherEnd) #if ($target.navigable || ($associationEnd.child && $entity.foreignHibernateGeneratorClass)) #if ($target.many) private $target.getterSetterTypeName $target.name = $target.collectionTypeImplementation; #else private $target.getterSetterTypeName $target.name; #end #end #end // ----- Accessors ----- ## **** Generate accessors for attributes **** #foreach ( $attribute in $entity.attributes ) #set ($typeName = $attribute.type.fullyQualifiedName) #if ($attribute.containsEmbeddedObject) #set ($typeName = $attribute.type.fullyQualifiedEntityName) #end /// <summary> $attribute.getDocumentation(" /// ") /// </summary> $attribute.visibility virtual $typeName ${stringUtils.upperCamelCaseName($attribute.name)} { get { return $attribute.name; } set { this.$attribute.name = value; } } #end ## **** Generate accessors for associations **** #foreach ($associationEnd in $entity.associationEnds) #set ($target = $associationEnd.otherEnd) #if ($target.navigable || ($associationEnd.child && $entity.foreignHibernateGeneratorClass)) /// <summary> $target.getDocumentation(" /// ") /// </summary> public virtual $target.getterSetterTypeName ${stringUtils.upperCamelCaseName($target.name)} { get { return $target.name; } set { this.$target.name = value; } } #end #end // ----- Abstract Methods ----- #foreach ($operation in $entity.businessOperations) #set ($returnType = $operation.returnType) #set ($signature = $operation.signature) /// <summary> $operation.getDocumentation(" /// ") /// </summary> $operation.visibility abstract $returnType.fullyQualifiedName $signature; #end // ----- Helper Methods ----- #if ($generateEntityEqualsAndHashCode.equalsIgnoreCase('true')) #set ($identifiers = $entity.getIdentifiers(false)) /// <summary> #if ($identifiers.empty) /// This entity does not have any identifiers #if ($entity.generalization) /// but since it extends the <code>$entity.generalization.fullyQualifiedEntityImplementationName</code> class /// it will simply delegate the call up there. /// /// @see $entity.generalization.fullyQualifiedEntityName#Equals(Object) #else /// and is not extending any other entity, /// so this method will only return <code>true</code> if the argument reference and <code>this</code> /// refer to the same object. #end #else #if ($entity.generalization) /// Returns <code>true</code> if the argument is a $entity.entityName instance and all identifiers for this entity /// equal the identifiers of the argument entity. The <code>equals</code> method of the parent entity /// will also need to return <code>true</code>. Returns <code>false</code> otherwise. /// /// @see $entity.generalization.fullyQualifiedEntityName#Equals(Object) #else /// Returns <code>true</code> if the argument is a $entity.entityName instance and all identifiers for this entity /// equal the identifiers of the argument entity. Returns <code>false</code> otherwise. #end #end /// </summary> #renderEqualsMethod($entity) /// <summary> #if ($identifiers.empty) /// This entity does not have any identifiers #if ($entity.generalization) /// but since it extends the <code>$entity.generalization.fullyQualifiedEntityImplementationName</code> class /// it will simply delegate the call up there. /// /// @see $entity.generalization.fullyQualifiedEntityName#GetHashCode() #else /// and is not extending any other entity, /// so this method will only take the identifiers of this entity into account when calculating the hash code. #end #else #if ($entity.generalization) /// Returns a hash code based on this entity's identifiers and the hash code of the parent entity. /// /// @see $entity.generalization.fullyQualifiedEntityName#GetHashCode() #else /// Returns a hash code based on this entity's identifiers. #end #end /// </summary> #renderHashCodeMethod($entity $identifiers) #end #if (!$entity.abstract) /// <summary> /// Returns a String representation of this Entity /// </summary> public override String ToString() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append("$entity.name: "); #set ($attributes = $entity.getAttributes(true,true)) #foreach($attribute in $attributes) sb.Append("$attribute.name").Append('=').Append(${stringUtils.upperCamelCaseName($attribute.name)})#if($velocityCount != $attributes.size()).Append(", ")#end; #end return sb.ToString(); } #end #if (!$entity.abstract && ($visualStudioVersion != "2003")) #set ($concreteBaseClass = $entity.generalization && !$entity.generalization.abstract) /// <summary> /// Constructs new instances of {@link ${entity.fullyQualifiedName}}. /// </summary> public static#if ($concreteBaseClass) new#end class Factory { /// <summary> /// Constructs a new instance of {@link ${entity.fullyQualifiedName}}. /// </summary> public static $entity.fullyQualifiedName newInstance() { return new ${entity.fullyQualifiedEntityImplementationName}(); } } #end // HibernateEntity.vsl merge-point } #if (!$entity.abstract && ($visualStudioVersion == "2003")) #set ($concreteBaseClass = $entity.generalization && !$entity.generalization.abstract) /// <summary> /// Constructs new instances of {@link ${entity.fullyQualifiedName}}. /// </summary> public class ${entity.Name}Factory { /// <summary> /// Constructs a new instance of {@link ${entity.fullyQualifiedName}}. /// </summary> public static $entity.fullyQualifiedName newInstance() { return new ${entity.fullyQualifiedEntityImplementationName}(); } } #end #if ($stringUtils.isNotBlank($entity.packageName)) } #end 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/NHibernateEntityImpl.vsl Index: NHibernateEntityImpl.vsl =================================================================== #set ($generatedFile = "${entity.packagePath}/${entity.entityImplementationName}.cs") // Name: ${entity.entityImplementationName}.cs // license-header cs merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: HibernateEntityImpl.vsl in andromda-nhibernate-cartridge. using System; #if ($stringUtils.isNotBlank($entity.packageName)) namespace $entity.packageName { #end /// <summary> /// @see $entity.fullyQualifiedEntityName /// </summary> [Serializable] public#if ($entity.abstract) abstract#end class $entity.entityImplementationName : $entity.fullyQualifiedEntityName { } #if ($stringUtils.isNotBlank($entity.packageName)) } #end 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/nhibernate.cfg.xml.vsl Index: nhibernate.cfg.xml.vsl =================================================================== <?xml version="1.0" encoding="$xmlEncoding"?> <!-- Attention: Generated code! Do not modify by hand! Generated by: hibernate.cfg.xml.vsl in andromda-nhibernate-cartridge. --> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> <hibernate-configuration> <session-factory> <!-- properties --> #if ($stringUtils.isNotBlank($driver)) <property name="connection.driver_class">$driver</property> #end #if ($stringUtils.isNotBlank($username)) <property name="connection.username">$username</property> #end #if ($stringUtils.isNotBlank($password)) <property name="connection.password">$password</property> #end #if ($stringUtils.isNotBlank($dataSource)) <property name="connection.datasource">$dataSource</property> #end #if ($stringUtils.isNotBlank($connectionUrl)) <property name="connection.url">$connectionUrl</property> #end #if ($stringUtils.isNotBlank($hibernatePoolSize)) <property name="pool.size">$hibernatePoolSize</property> #end #if ($stringUtils.isNotBlank($hibernateTransactionManagerStrategy)) <property name="transaction.manager.strategy">$hibernateTransactionManagerStrategy</property> #end #if ($stringUtils.isNotBlank($hibernateUserTransactionName)) <property name="jta.UserTransaction">$hibernateUserTransactionName</property> #end #if ($stringUtils.isNotBlank($hibernateTransactionFactoryClass)) <property name="transaction.factory_class">$hibernateTransactionFactoryClass</property> #end #if ($stringUtils.isNotBlank($hibernateTransactionManagerLookup)) <property name="transaction.manager_lookup_class">$hibernateTransactionManagerLookup</property> #end #if ($stringUtils.isNotBlank($hibernateUseOuterJoin)) <property name="use_outer_join">$hibernateUseOuterJoin</property> #end #if ($stringUtils.isNotBlank($hibernateShowSql)) <property name="show_sql">$hibernateShowSql</property> #end #if ($stringUtils.isNotBlank($hibernateJndiName)) <property name="session_factory_name">$hibernateJndiName</property> #end #if ($stringUtils.isNotBlank($hibernateDialect)) <property name="dialect">$hibernateDialect</property> #end #if ($stringUtils.isNotBlank($hibernateDefaultSchema)) <property name="default_schema">$hibernateDefaultSchema</property> #end #if ($stringUtils.isNotBlank($hibernateMaxFetchDepth)) <property name="max_fetch_depth">$hibernateMaxFetchDepth</property> #end #if ($stringUtils.isNotBlank($hibernateJdbcFetchSize)) <property name="jdbc.fetch_size">$hibernateJdbcFetchSize</property> #end #if ($stringUtils.isNotBlank($hibernateJdbcBatchSize)) <property name="jdbc.batch_size">$hibernateJdbcBatchSize</property> #end #if ($stringUtils.isNotBlank($hibernateJdbcUseScrollableResultSet)) <property name="jdbc.use_scrollable_resultset">$hibernateJdbcUseScrollableResultSet</property> #end #if ($stringUtils.isNotBlank($hibernateJdbcUseStreamsForBinary)) <property name="use_streams_for_binary">$hibernateJdbcUseStreamsForBinary</property> #end #if ($stringUtils.isNotBlank($hibernateHbm2DDLAuto)) <property name="hibernate.hbm2ddl.auto">$hibernateHbm2DDLAuto</property> #end #if ($stringUtils.isNotBlank($hibernateQuerySubstitutions)) <property name="hibernate.query.substitutions">$hibernateQuerySubstitutions</property> #end #if ($stringUtils.isNotBlank($hibernateEnableCache)) <property name="hibernate.cache.use_query_cache">$hibernateEnableCache</property> #end #if ($stringUtils.isNotBlank($hibernateCacheProvider)) <property name="hibernate.cache.provider_class">$hibernateCacheProvider</property> #end #if ($stringUtils.isNotBlank($hibernateQueryCacheFactory)) <property name="hibernate.cache.query_cache_factory">$hibernateQueryCacheFactory</property> #end <!-- mapping files --> #foreach($entity in $entities) <mapping resource="${entity.packagePath}/${entity.entityName}.hbm.xml"/> #end </session-factory> </hibernate-configuration> 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/nhibernate.cs.vm Index: nhibernate.cs.vm =================================================================== ## ## This macro will render the Equals() method. ## If an entity is rendered, only the identifiers are compared. ## If an embedded value is renderer, then all attributes are compared. ## #macro (renderEqualsMethod $class) #if ($class.class.name == "org.andromda.cartridges.nhibernate.metafacades.HibernateEntityLogicImpl") #set ($isEntity = true) #set ($attributeSet = $class.getIdentifiers(false)) #else #set ($isEntity = false) #set ($attributeSet = $class.attributes) #end public override bool Equals(Object obj) { #if ($attributeSet.empty) return base.Equals(obj); #else if (this == obj) { return true; } if (GetType() != obj.GetType()) { return false; } $class.name that = ($class.name)obj; #foreach ($attribute in $attributeSet) #set ($attrType = $attribute.type) #set ($attrName = ${stringUtils.upperCamelCaseName($attribute.name)}) #if ($attrType.primitive) #if ($isEntity) if (this.$attrName == 0 || that.$attrName == 0 || this.$attrName != that.$attrName) { return false; } #else if (this.$attrName != that.$attrName) { return false; } #end #elseif ($attrType.enumeration) if (this.$attrName != that.$attrName) { return false; } #elseif ($attrType.arrayType) if (!cs.util.Arrays.equals(this.$attrName, that.$attrName)) { return false; } #else if (this.$attrName == null || that.$attrName == null || !this.${attrName}.Equals(that.$attrName)) { return false; } #end #end return true; #end } #end ## ## This macro will render the GetHashCode() method ## If an entity is rendered, the attributeSet consists of the identifiers, ## if an value type is renderer, the attributeSet consists of all attributes ## #macro (renderHashCodeMethod $class $attributeSet) public override int GetHashCode() { #if ($attributeSet.empty) return base.GetHashCode(); #else #if ($class.generalization) int hashCode = base.GetHashCode(); #else int hashCode = 0; #end #foreach ($attribute in $attributeSet) #set ($attrType = $attribute.type) #set ($attrName = ${stringUtils.upperCamelCaseName($attribute.name)}) #if ($attribute.getterSetterTypeName == "bool") hashCode = 29 * hashCode + (${attrName} ? 1 : 0); #elseif ($attribute.getterSetterTypeName == "System.Guid") hashCode = 29 * hashCode + ${attrName}.GetHashCode(); #elseif ($attrType.arrayType) // arrays are not part of the hashCode calculation #elseif ($attrType.primitive || $attrType.enumeration) hashCode = 29 * hashCode + (int)${attrName}; #else hashCode = 29 * hashCode + (${attrName} == null ? 0 : ${attrName}.GetHashCode()); #end## if #end## foreach return hashCode; #end## $attributeSet.empty } #end 1.1 cartridges/andromda-nhibernate/src/main/resources/templates/nhibernate/nhibernate.hbm.xml.vm Index: nhibernate.hbm.xml.vm =================================================================== ## ## This macro will render any properties and associations. ## $entity can be of type HibernateEntity or HibernateEmbeddedValue ## #macro (renderPropertiesAndAssociations $entity $paramSqlPrefix) ## **** Generate attributes **** #foreach ($attribute in $entity.attributes) #if (!$attribute.identifier) #set ($fullyQualifiedPropertyType = $attribute.type.fullyQualifiedHibernateType) #if ($attribute.type.enumeration) #set ($fullyQualifiedPropertyType = "$attribute.type.fullyQualifiedHibernateType, ${commonAssemblyName}") #end #if ($attribute.containsEmbeddedObject) <component name="$stringUtils.upperCamelCaseName($attribute.name)" class="${attribute.type.packageName}.${attribute.type.implementationName}, ${coreAssemblyName}"> ## render the properties of the embedded type #set ($sqlPrefix = $attribute.columnName) #renderPropertiesAndAssociations($attribute.type $sqlPrefix) </component> #elseif($attribute.formula) <property name="$stringUtils.upperCamelCaseName($attribute.name)" type="$fullyQualifiedPropertyType" formula="$attribute.formula" /> #else <property name="$stringUtils.upperCamelCaseName($attribute.name)" type="$fullyQualifiedPropertyType"#if(!$attribute.insertEnabled) insert="false"#end#if(!$attribute.updateEnabled) update="false"#end> ## do not specify sql-type for enumerations. NHibernate prefers to do it based on the underlying enum type. <column name="$attribute.concatColumnName($paramSqlPrefix, $attribute.columnName)" not-null="$attribute.required" unique="$attribute.unique"#if(!$attribute.type.enumeration) sql-type="$attribute.sqlType"#end#if($attribute.columnIndex) index="$attribute.columnIndex"#end/> </property> #end #end #end ## **** Generate associations **** #foreach ($sourceEnd in $entity.associationEnds) #set ($otherEnd = $sourceEnd.otherEnd) #if ($otherEnd.navigable) #if ($sourceEnd.one2One) #if ($sourceEnd.one2OnePrimary || (!$sourceEnd.navigable && !$entity.foreignHibernateGeneratorClass)) #if ($otherEnd.type.foreignHibernateGeneratorClass) <one-to-one name="$stringUtils.upperCamelCaseName($otherEnd.name)" class="$otherEnd.type.fullyQualifiedEntityImplementationName, ${coreAssemblyName}" outer-join="$otherEnd.outerJoin"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end/> #else <many-to-one name="$stringUtils.upperCamelCaseName($otherEnd.name)" class="$otherEnd.type.fullyQualifiedEntityImplementationName, ${coreAssemblyName}" foreign-key="$otherEnd.foreignKeyConstraintName" outer-join="$otherEnd.outerJoin"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end#if($otherEnd.columnIndex) index="$otherEnd.columnIndex"#end> <column name="$otherEnd.columnName" not-null="$otherEnd.required" sql-type="$otherEnd.sqlType" unique="true"/> </many-to-one> #end #else #if ($entity.foreignHibernateGeneratorClass) <one-to-one name="$stringUtils.upperCamelCaseName($otherEnd.name)" class="$otherEnd.type.fullyQualifiedEntityImplementationName, ${coreAssemblyName}" foreign-key="$otherEnd.foreignKeyConstraintName" outer-join="$otherEnd.outerJoin"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end constrained="true"/> #else <one-to-one name="$stringUtils.upperCamelCaseName($otherEnd.name)" class="$otherEnd.type.fullyQualifiedEntityImplementationName, ${coreAssemblyName}" outer-join="$otherEnd.outerJoin" property-ref="$stringUtils.upperCamelCaseName($sourceEnd.name)"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end/> #end #end #end #if ($sourceEnd.one2Many) #if ($otherEnd.set || $otherEnd.map) <$otherEnd.collectionType name="$stringUtils.upperCamelCaseName($otherEnd.name)" order-by="$otherEnd.orderByColumns" lazy="$otherEnd.lazy" outer-join="$otherEnd.outerJoin" inverse="$otherEnd.hibernateInverse"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end#if ($otherEnd.whereClause) where="$otherEnd.whereClause"#end#if ($stringUtils.isNotBlank($otherEnd.sortType)) sort="$otherEnd.sortType"#end> #elseif ($otherEnd.bag) <$otherEnd.collectionType name="$stringUtils.upperCamelCaseName($otherEnd.name)" order-by="$otherEnd.orderByColumns" lazy="$otherEnd.lazy" outer-join="$otherEnd.outerJoin" inverse="$otherEnd.hibernateInverse"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end#if ($otherEnd.whereClause) where="$otherEnd.whereClause"#end> #elseif ($otherEnd.list) <$otherEnd.collectionType name="$stringUtils.upperCamelCaseName($otherEnd.name)" lazy="$otherEnd.lazy" outer-join="$otherEnd.outerJoin" inverse="$otherEnd.hibernateInverse"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end#if ($otherEnd.whereClause) where="$otherEnd.whereClause"#end> #end #if(($hibernateEnableCache.equalsIgnoreCase("true")) && ($hibernateEnableAssociationsCache.equalsIgnoreCase("true"))) <cache usage="$sourceEnd.association.hibernateCacheType" /> #end <key foreign-key="$sourceEnd.foreignKeyConstraintName"> <column name="$sourceEnd.columnName" sql-type="$sourceEnd.sqlType"/> </key> #if ($otherEnd.indexedCollection) <index column="$otherEnd.collectionIndexName"#if($otherEnd.map) type="$otherEnd.collectionIndexType"#end/> #end <one-to-many class="$otherEnd.type.fullyQualifiedEntityImplementationName, ${coreAssemblyName}"/> </$otherEnd.collectionType> #elseif ($sourceEnd.many2One) <many-to-one name="$stringUtils.upperCamelCaseName($otherEnd.name)" class="$otherEnd.type.fullyQualifiedEntityImplementationName, ${coreAssemblyName}" outer-join="$otherEnd.outerJoin"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end foreign-key="$otherEnd.foreignKeyConstraintName"#if($otherEnd.columnIndex) index="$otherEnd.columnIndex"#end> <column name="$otherEnd.columnName" not-null="$otherEnd.required" sql-type="$otherEnd.sqlType"/> </many-to-one> #elseif ($sourceEnd.many2Many) <$otherEnd.collectionType name="$stringUtils.upperCamelCaseName($otherEnd.name)" table="$otherEnd.association.tableName" order-by="$sourceEnd.orderByColumns" outer-join="$otherEnd.outerJoin" lazy="$otherEnd.lazy" inverse="$otherEnd.hibernateInverse"#if ($otherEnd.hibernateCascade) cascade="$otherEnd.hibernateCascade"#end#if ($otherEnd.whereClause) where="$otherEnd.whereClause"#end> <key foreign-key="$sourceEnd.foreignKeyConstraintName"> <column name="$sourceEnd.columnName" sql-type="$sourceEnd.sqlType"/> </key> <many-to-many class="$otherEnd.type.fullyQualifiedEntityImplementationName, ${coreAssemblyName}" foreign-key="$otherEnd.foreignKeyConstraintName"> <column name="$otherEnd.columnName" sql-type="$otherEnd.sqlType"#if($otherEnd.columnIndex) index="$otherEnd.columnIndex"#end/> </many-to-many> </$otherEnd.collectionType> #end #end #end #end ## ## This macro will render any sub mappings elements for the given $entity. ## #macro (renderSubClass $entity) ## Should only get get invoked for inheritance class or subclass. <$entity.mappingClassName name="$entity.fullyQualifiedEntityImplementationName, ${coreAssemblyName}"#if($entity.tableRequired) table="$entity.tableName"#else discriminator-value="$entity.entityImplementationName"#end lazy="$entity.lazy"#if($entity.hibernateProxy) proxy="$entity.fullyQualifiedEntityImplementationName"#end dynamic-insert="$entity.dynamicInsert" dynamic-update="$entity.dynamicUpdate"> #if($entity.subclassKeyColumn) <key foreign-key="${entity.tableName}_INHERITANCE_FKC"> <column name="$entity.subclassKeyColumn" sql-type="$identifier.sqlType"/> </key> #end #renderPropertiesAndAssociations($entity "") #foreach ($subentity in $entity.specializations) #renderSubClass($subentity) #end </$entity.mappingClassName> #end 1.1 cartridges/andromda-nhibernate/src/main/java/org/andromda/cartridges/nhibernate/metafacades/HibernateFinderMethodArgumentLogicImpl.java Index: HibernateFinderMethodArgumentLogicImpl.java =================================================================== package org.andromda.cartridges.nhibernate.metafacades; import org.andromda.metafacades.uml.ClassifierFacade; /** * MetafacadeLogic implementation for * org.andromda.cartridges.nhibernate.metafacades.HibernateFinderMethodArgument. * * @see org.andromda.cartridges.nhibernate.metafacades.HibernateFinderMethodArgument */ public class HibernateFinderMethodArgumentLogicImpl extends HibernateFinderMethodArgumentLogic { // ---------------- constructor ------------------------------- public HibernateFinderMethodArgumentLogicImpl( Object metaObject, String context) { super(metaObject, context); } /** * Defines if specific setters methods will be created for primitive types * and dates */ private static final String USE_SPECIALIZED_SETTERS = "hibernateQueryUseSpecializedSetters"; /** * @see org.andromda.cartridges.nhibernate.metafacades.HibernateFinderMethodArgument#getQueryArgumentNameSetter() */ protected java.lang.String handleGetQueryArgumentNameSetter() { StringBuffer setterName = new StringBuffer(); boolean specializedSetters = Boolean.valueOf(String.valueOf(this.getConfiguredProperty(USE_SPECIALIZED_SETTERS))).booleanValue(); ClassifierFacade classifier = this.getType(); if (classifier != null) { if (specializedSetters) { if (classifier.isPrimitive()) { setterName.append("set" + classifier.getWrapperName().replaceAll("(.)*\\.", "")); } else if (classifier.isDateType() || classifier.isStringType()) { setterName.append("set" + classifier.getName()); } else { setterName.append("setParameter"); } } else { setterName.append("setParameter"); } if (classifier.isCollectionType()) { setterName.append("List"); } } return setterName.toString(); } } 1.1 cartridges/andromda-nhibernate/src/main/java/org/andromda/cartridges/nhibernate/metafacades/HibernateMetafacadeUtils.java Index: HibernateMetafacadeUtils.java =================================================================== package org.andromda.cartridges.nhibernate.metafacades; import java.util.Collection; import org.andromda.cartridges.nhibernate.HibernateProfile; import org.andromda.core.common.ExceptionUtils; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.FilteredCollection; import org.andromda.metafacades.uml.ModelElementFacade; import org.andromda.metafacades.uml.OperationFacade; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.apache.commons.lang.StringUtils; /** * Contains utilities for use with Hibernate metafacades. * * @author Chad Brandon */ class HibernateMetafacadeUtils { /** * Gets the view type for the passed in <code>classifier</code>. If the * view type can be retrieved from the <code>classifier</code>, then that * is used, otherwise the <code>defaultViewType</code> is returned. * * @return String the view type name. */ static String getViewType( ClassifierFacade classifier, String defaultViewType) { final String methodName = "HibernateMetafacadeUtils.getViewType"; ExceptionUtils.checkNull(methodName, "classifer", classifier); String viewType = null; if (classifier.hasStereotype(HibernateProfile.STEREOTYPE_SERVICE)) { String viewTypeValue = (String)classifier.findTaggedValue(HibernateProfile.TAGGEDVALUE_EJB_VIEWTYPE); // if the view type wasn't found, search all super classes if (StringUtils.isEmpty(viewTypeValue)) { viewType = (String)CollectionUtils.find( classifier.getAllGeneralizations(), new Predicate() { public boolean evaluate(Object object) { return ((ModelElementFacade)object).findTaggedValue( HibernateProfile.TAGGEDVALUE_EJB_VIEWTYPE) != null; } }); } if (StringUtils.isNotEmpty(viewTypeValue)) { viewType = viewTypeValue; } } if (StringUtils.isEmpty(viewType)) { viewType = defaultViewType; } return viewType.toLowerCase(); } /** * Creates a fully qualified name from the given <code>packageName</code>, * <code>name</code>, and <code>suffix</code>. * * @param packageName the name of the model element package. * @param name the name of the model element. * @param suffix the suffix to append. * @return the new fully qualified name. */ static String getFullyQualifiedName( String packageName, String name, String suffix) { StringBuffer fullyQualifiedName = new StringBuffer(StringUtils.trimToEmpty(packageName)); if (StringUtils.isNotBlank(packageName)) { fullyQualifiedName.append('.'); } fullyQualifiedName.append(StringUtils.trimToEmpty(name)); fullyQualifiedName.append(StringUtils.trimToEmpty(suffix)); return fullyQualifiedName.toString(); } /** * filters all static operations */ static java.util.Collection filterBusinessOperations(Collection operations) { Collection businessOperations = new FilteredCollection(operations) { public boolean evaluate(Object object) { return !((OperationFacade)object).isStatic(); } }; return businessOperations; } } 1.1 cartridges/andromda-nhibernate/src/main/java/org/andromda/cartridges/nhibernate/metafacades/HibernateAssociationEndLogicImpl.java Index: HibernateAssociationEndLogicImpl.java =================================================================== package org.andromda.cartridges.nhibernate.metafacades; import java.util.ArrayList; import java.util.Collection; import org.andromda.cartridges.nhibernate.HibernateProfile; import org.andromda.metafacades.uml.ClassifierFacade; import org.andromda.metafacades.uml.EntityAssociationEnd; import org.andromda.metafacades.uml.EntityMetafacadeUtils; import org.andromda.metafacades.uml.TypeMappings; import org.andromda.metafacades.uml.UMLMetafacadeProperties; import org.andromda.metafacades.uml.UMLProfile; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; /** * MetafacadeLogic implementation for * org.andromda.cartridges.nhibernate.metafacades.HibernateAssociationEnd. * * @see org.andromda.cartridges.nhibernate.metafacades.HibernateAssociationEnd */ public class HibernateAssociationEndLogicImpl extends HibernateAssociationEndLogic { public HibernateAssociationEndLogicImpl( Object metaObject, String context) { super(metaObject, context); } /** * Value for set */ private static final String COLLECTION_TYPE_SET = "set"; /** * Value for map */ private static final String COLLECTION_TYPE_MAP = "map"; /** * Value for bags */ private static final String COLLECTION_TYPE_BAG = "bag"; /** * Value for list */ private static final String COLLECTION_TYPE_LIST = "list"; /** * Value for collections */ private static final String COLLECTION_TYPE_COLLECTION = "collection"; /** * Stores the valid collection types */ private static final Collection collectionTypes = new ArrayList(); static { collectionTypes.add(COLLECTION_TYPE_SET); collectionTypes.add(COLLECTION_TYPE_MAP); collectionTypes.add(COLLECTION_TYPE_BAG); collectionTypes.add(COLLECTION_TYPE_LIST); collectionTypes.add(COLLECTION_TYPE_COLLECTION); } /** * Stores the property indicating whether or not composition should define * the eager loading strategy. */ private static final String COMPOSITION_DEFINES_EAGER_LOADING = "compositionDefinesEagerLoading"; /** * Stores the default outerjoin setting for this association end. */ private static final String PROPERTY_ASSOCIATION_END_OUTERJOIN = "hibernateAssociationEndOuterJoin"; /** * Stores the default collection index name. */ private static final String COLLECTION_INDEX_NAME = "associationEndCollectionIndexName"; /** * Stores the default collection index type. */ private static final String COLLECTION_INDEX_TYPE = "associationEndCollectionIndexType"; /** * Stores the value of the cascade behavior when modeling an aggregation. */ private static final String HIBERNATE_AGGREGATION_CASCADE = "hibernateAggregationCascade"; /** * Stores the value of the cascade behavior when modeling a composition. */ private static final String HIBERNATE_COMPOSITION_CASCADE = "hibernateCompositionCascade"; /** * @see org.andromda.cartridges.nhibernate.metafacades.HibernateEntityAssociationEnd#isOne2OnePrimary() */ protected boolean handleIsOne2OnePrimary() { return (this.isOne2One() && (this.isAggregation() || this.isComposition())); } /** * @see org.andromda.metafacades.uml.AssociationEndFacade#getGetterSetterTypeName() */ public String getGetterSetterTypeName() { String getterSetterTypeName = super.getGetterSetterTypeName(); if (!this.isMany()) { ClassifierFacade type = this.getType(); if (type instanceof HibernateEntity) { final String typeName = ((HibernateEntity)type).getFullyQualifiedEntityName(); if (StringUtils.isNotEmpty(typeName)) { getterSetterTypeName = typeName; } } } if (this.isMany()) { final boolean specificInterfaces = Boolean.valueOf( ObjectUtils.toString(this.getConfiguredProperty(HibernateGlobals.SPECIFIC_COLLECTION_INTERFACES))) .booleanValue(); final TypeMappings mappings = this.getLanguageMappings(); if (mappings != null) { if (this.isMap()) { getterSetterTypeName = mappings.getTo(UMLProfile.MAP_TYPE_NAME); } else if (specificInterfaces) { if (this.isSet()) { getterSetterTypeName = mappings.getTo(UMLProfile.SET_TYPE_NAME); } else if (this.isList()) { getterSetterTypeName = mappings.getTo(UMLProfile.LIST_TYPE_NAME); } } else { getterSetterTypeName = ObjectUtils.toString(this.getConfiguredProperty(HibernateGlobals.DEFAULT_COLLECTION_INTERFACE)); } } else { getterSetterTypeName = ObjectUtils.toString(this.getConfiguredProperty(HibernateGlobals.DEFAULT_COLLECTION_INTERFACE)); } } return getterSetterTypeName; } /** * @see org.andromda.metafacades.uml.AssociationEndFacade#isLazy() */ protected boolean handleIsLazy() { String lazyString = (String)findTaggedValue(HibernateProfile.TAGGEDVALUE_HIBERNATE_LAZY); boolean lazy = true; if (lazyString == null) { // check whether or not composition defines eager loading is turned // on boolean compositionDefinesEagerLoading = Boolean.valueOf(String.valueOf(this.getConfiguredProperty(COMPOSITION_DEFINES_EAGER_LOADING))) .booleanValue(); if (compositionDefinesEagerLoading) { lazy = !this.getOtherEnd().isComposition(); } } else { lazy = Boolean.valueOf(lazyString).booleanValue(); } return lazy; } /** * calculates the hibernate cascade attribute of this association end. * * @return null if no relevant cascade attribute to deliver * @see org.andromda.cartridges.nhibernate.metafacades.HibernateEntityAssociationEnd#getHibernateCascade() */ protected String handleGetHibernateCascade() { String cascade = null; final String individualCascade = (String)findTaggedValue(HibernateProfile.TAGGEDVALUE_HIBERNATE_CASCADE); if ((individualCascade != null) && (individualCascade.length() > 0)) { cascade = individualCascade; } else if (this.isChild()) // other end is a composition { if (StringUtils.isBlank(this.getHibernateCompositionCascade())) { cascade = HibernateGlobals.HIBERNATE_CASCADE_DELETE; final Object type = this.getType(); if (type != null && type instanceof HibernateEntity) { HibernateEntity entity = (HibernateEntity)type; final String defaultCascade = entity.getHibernateDefaultCascade(); if (defaultCascade.equalsIgnoreCase(HibernateGlobals.HIBERNATE_CASCADE_SAVE_UPDATE) || defaultCascade.equalsIgnoreCase(HibernateGlobals.HIBERNATE_CASCADE_ALL)) { if (this.isMany()) { cascade = HibernateGlobals.HIBERNATE_CASCADE_ALL_DELETE_ORPHAN; } else { cascade = HibernateGlobals.HIBERNATE_CASCADE_ALL; } } } } else { cascade = this.getHibernateCompositionCascade(); } } else if (this.isCompos... [truncated message content] |
From: Eric C <ecr...@us...> - 2006-03-08 04:11:11
|
User: ecrutchfield Date: 06/03/07 20:11:00 Added: andromda-cs pom.xml .cvsignore andromda-cs/src/site site.xml andromda-cs/src/main/resources/templates/cs ApplicationException.vsl UnexpectedException.vsl ExceptionUtils.vm ExceptionUtilsImports.vm Service.vsl Interface.vsl Enumeration.vsl ServiceImpl.vsl ValueObject.vsl andromda-cs/src/main/resources/META-INF/andromda namespace.xml cartridge.xml profile.xml andromda-cs/src/test/uml CsCartridgeTestModel.xml.zip andromda-cs/src/main/uml empty-model.xmi andromda-cs/src/test/mappings MergeMappings.xml andromda-cs/src/site/xdoc index.xml andromda-cs/src/test/expected cartridge-output.zip andromda-cs/conf/test andromda.xml Log: add cs cartridge Revision Changes Path 1.1 cartridges/andromda-cs/pom.xml Index: pom.xml =================================================================== <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.andromda.cartridges</groupId> <artifactId>andromda-cartridge-plugins</artifactId> <version>1.0-SNAPSHOT</version> </parent> <artifactId>andromda-cs-cartridge</artifactId> <packaging>andromda-cartridge</packaging> <name>AndroMDA C# Cartridge</name> <description>Produces C# value objects from a model.</description> <developers> <developer> <name>Naresh Bhatia</name> <id>nbhatia</id> <email>na...@an...</email> <roles> <role>Developer</role> </roles> </developer> </developers> <build> <plugins> <plugin> <groupId>org.andromda.maven.plugins</groupId> <artifactId>andromda-maven-plugin</artifactId> <dependencies> <dependency> <groupId>org.andromda.cartridges</groupId> <artifactId>andromda-meta-cartridge</artifactId> <version>3.2-RC1-SNAPSHOT</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.andromda.maven.plugins</groupId> <artifactId>andromda-cartridge-plugin</artifactId> </plugin> <plugin> <artifactId>maven-site-plugin</artifactId> <configuration> <locales>en</locales> </configuration> </plugin> </plugins> </build> <properties> <maven.test.skip>true</maven.test.skip> <model.uri>file:${pom.basedir}/src/main/uml/empty-model.xmi</model.uri> <test.model.uri>jar:file:${pom.basedir}/src/test/uml/CsCartridgeTestModel.xml.zip!/CsCartridgeTestModel.xml</test.model.uri> </properties> </project> 1.1 cartridges/andromda-cs/.cvsignore Index: .cvsignore =================================================================== target *.log *.exc 1.1 cartridges/andromda-cs/src/site/site.xml Index: site.xml =================================================================== <?xml version="1.0" encoding="iso-8859-1"?> <project name="C# Cartridge Plugin"> <title>C# Cartridge</title> <banner> <name>AndroMDA</name> <href>http://team.andromda.org/</href> </banner> <body> <links> <item name="C#" href="index.html"/> <item name="Cartridges" href="../andromda-cartridges/index.html"/> <item name="AndroMDA" href="../index.html"/> </links> <menu name="Overview"> <item name="Profile" href="profile.html"/> <item name="Namespace" href="namespace.html"/> </menu> </body> </project> 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/ApplicationException.vsl Index: ApplicationException.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand!! // Generated by: ApplicationException.vsl in andromda-java-cartridge. // #if ($stringUtils.isNotBlank($class.packageName)) package $class.packageName; #end #parse("templates/cs/ExceptionUtilsImports.vm") /** $class.getDocumentation(" * ") */ public class ${class.name} #if($class.generalization) extends ${class.generalization.fullyQualifiedName} #else extends java.lang.Exception #end { /** * The default constructor. */ public ${class.name}() {} /** * Constructs a new instance of ${class.name} * * @param throwable the parent Throwable */ public ${class.name}(Throwable throwable) { super(findRootCause(throwable)); } /** * Constructs a new instance of ${class.name} * * @param message the throwable message. */ public ${class.name}(String message) { super(message); } /** * Constructs a new instance of ${class.name} * * @param message the throwable message. * @param throwable the parent of this Throwable. */ public ${class.name}(String message, Throwable throwable) { super(message, findRootCause(throwable)); } #parse("templates/cs/ExceptionUtils.vm") } 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/UnexpectedException.vsl Index: UnexpectedException.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: UnexpectedException.vsl in andromda-java-cartridge. // #if ($stringUtils.isNotBlank($class.packageName)) package $class.packageName; #end #parse("templates/cs/ExceptionUtilsImports.vm") /** $class.getDocumentation(" * ") */ public class ${class.name} #if($class.generalization) extends ${class.generalization.fullyQualifiedName} #else extends java.lang.RuntimeException #end { /** * The default constructor. */ public ${class.name}() {} /** * Constructs a new instance of ${class.name} * * @param throwable the parent Throwable */ public ${class.name}(Throwable throwable) { super(findRootCause(throwable)); } /** * Constructs a new instance of ${class.name} * * @param message the throwable message. */ public ${class.name}(String message) { super(message); } /** * Constructs a new instance of ${class.name} * * @param message the throwable message. * @param throwable the parent of this Throwable. */ public ${class.name}(String message, Throwable throwable) { super(message, findRootCause(throwable)); } #parse("templates/cs/ExceptionUtils.vm") } 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/ExceptionUtils.vm Index: ExceptionUtils.vm =================================================================== ## Contains exception utilities used within the exception templates /** * Finds the root cause of the parent exception * by traveling up the exception tree */ private static Throwable findRootCause(Throwable th) { if (th != null) { // Lets reflectively get any JMX or EJB exception causes. try { Throwable targetException = null; // java.lang.reflect.InvocationTargetException // or javax.management.ReflectionException String exceptionProperty = "targetException"; if (PropertyUtils.isReadable(th, exceptionProperty)) { targetException = (Throwable)PropertyUtils.getProperty(th, exceptionProperty); } else { exceptionProperty = "causedByException"; //javax.ejb.EJBException if (PropertyUtils.isReadable(th, exceptionProperty)) { targetException = (Throwable)PropertyUtils.getProperty(th, exceptionProperty); } } if (targetException != null) { th = targetException; } } catch (Exception ex) { // just print the exception and continue ex.printStackTrace(); } if (th.getCause() != null) { th = th.getCause(); th = findRootCause(th); } } return th; } 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/ExceptionUtilsImports.vm Index: ExceptionUtilsImports.vm =================================================================== ## Contains the imports used by the methods in ExceptionUtils.vm import org.apache.commons.beanutils.PropertyUtils; 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/Service.vsl Index: Service.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: Service.vsl in andromda-java-cartridge. // #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; #end /** $service.getDocumentation(" * ") */ public interface $service.name #if($service.generalization) extends $service.generalization.fullyQualifiedName #end { #foreach ( $operation in $service.operations ) /** $operation.getDocumentation(" * ") */ #if ($operation.exceptionsPresent) $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature throws $operation.exceptionList; #else $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature; #end #end } 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/Interface.vsl Index: Interface.vsl =================================================================== // license-header java merge-point /* Autogenerated by AndroMDA C# cartridge (Interface.vsl) - do not edit */ #if ($stringUtils.isNotBlank($interface.packageName)) package $interface.packageName; #end /** $interface.getDocumentation(" * ") */ public interface $interface.name #if (!$interface.allGeneralizations.empty) extends $interface.generalizationList #end { #foreach($attribute in $interface.attributes) #if ($attribute.visibility == "public") #if ($attribute.static) /** $attribute.getDocumentation(" * ") */ public static final $attribute.type.fullyQualifiedName $attribute.name = $attribute.defaultValue; #else /** $attribute.getDocumentation(" * ") */ public $attribute.getterSetterTypeName ${attribute.getterName}(); /** $attribute.getDocumentation(" * ") */ public void ${attribute.setterName}($attribute.getterSetterTypeName $attribute.name); #end #end #end #foreach ($associationEnd in $interface.associationEnds) #set ($target = $associationEnd.otherEnd) #if ($target.navigable) /** * Get the $target.name $target.getDocumentation(" * ") */ public $target.getterSetterTypeName ${target.getterName}(); /** * Set the $target.name */ public void ${target.setterName}($target.getterSetterTypeName $target.name); #end #end #foreach ( $operation in $interface.operations) #if ($operation.visibility == "public") /** $operation.getDocumentation(" * ") */ #set ($returnType = $operation.returnType.fullyQualifiedName) #if ($operation.exceptionsPresent) public $returnType $operation.signature throws $operation.exceptionList; #else public $returnType $operation.signature; #end #end #end } 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/Enumeration.vsl Index: Enumeration.vsl =================================================================== // Name: ${enumeration.name}.cs // license-header cs merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: Enumeration.vsl in andromda-cs-cartridge. using System; #if ($stringUtils.isNotBlank($enumeration.packageName)) namespace $enumeration.packageName { #end /// <summary> $enumeration.getDocumentation(" /// ") /// </summary> public enum $enumeration.name { #foreach ($literal in $enumeration.literals) #if ($literal.defaultValue) $literal.name = $literal.enumerationValue#if($velocityCount != $enumeration.literals.size()),#end #else $literal.name#if($velocityCount != $enumeration.literals.size()),#end #end #end // Enumeration.vsl merge-point } #if ($stringUtils.isNotBlank($enumeration.packageName)) } #end 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/ServiceImpl.vsl Index: ServiceImpl.vsl =================================================================== // license-header java merge-point /** * This is only generated once! It will never be overwritten. * You can (and have to!) safely modify it by hand. */ #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; #end #set ($superclass = $service.generalization) /** * @see $service.fullyQualifiedName */ public class ${service.name}Impl #if($superclass) extends $superclass.fullyQualifiedName #end implements $service.fullyQualifiedName { #foreach ( $operation in $service.operations ) #set ($returnType = $operation.returnType) #set ($returnObject = "returnValue") #set ($signature = $operation.signature) /** * @see ${service.fullyQualifiedName}#${operation.getSignature(false)} */ #if ($operation.exceptionsPresent) $operation.visibility $returnType.fullyQualifiedName $signature throws $operation.exceptionList #else $operation.visibility $returnType.fullyQualifiedName $signature #end { //@todo implement $operation.visibility $returnType.fullyQualifiedName $signature #set ($returnTypeName = $operation.type.fullyQualifiedName) #if ($operation.returnTypePresent) #if (!$operation.type.primitive) return null; #elseif ("boolean" == $returnTypeName) return false; #else return ($returnTypeName)0; #end #else throw new java.lang.UnsupportedOperationException("${service.fullyQualifiedName}.${signature} Not implemented!"); #end } #end } 1.1 cartridges/andromda-cs/src/main/resources/templates/cs/ValueObject.vsl Index: ValueObject.vsl =================================================================== // Name: ${class.name}.cs // license-header cs merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: ValueObject.vsl in andromda-cs-cartridge. using System; #if ($stringUtils.isNotBlank($class.packageName)) namespace $class.packageName { #end /// <summary> $class.getDocumentation(" /// ") /// </summary> [Serializable] public#if($class.abstract) abstract#end class $class.name #if($class.generalization) : ${class.generalization.fullyQualifiedName} #end { // ----- Attributes and Associations ----- ## **** Generate attribute **** #foreach ($attribute in $class.attributes) private $attribute.getterSetterTypeName $attribute.name; #end ## **** Generate associations **** #foreach ($associationEnd in $class.associationEnds) #set ($target = $associationEnd.otherEnd) #if ($target.navigable) private $target.getterSetterTypeName $target.name; #end #end // ----- Constructors ----- #if (!$class.properties.empty) public ${class.name}() { } #end #if ($enablePropertyConstructors.equalsIgnoreCase('true')) #set ($propertiesNumber = $class.properties.size()) #if ($propertiesNumber == 0 || $propertiesNumber != 1 || !$class.properties.iterator().next().getterSetterTypeName.equals($class.fullyQualifiedName)) /// <summary> /// Constructor taking all properties. /// </summary> #set ($parenthesis = "(") #if ($class.properties.empty) #set ($parenthesis = "()") #end public ${class.name}${parenthesis} #foreach ($property in $class.properties) $property.getterSetterTypeName ${property.name}#if($velocityCount != $class.properties.size()),#else) #end #end { #foreach ($property in $class.properties) this.${property.name} = ${property.name}; #end } #end #end /// <summary> /// Copy constructor /// </summary> public ${class.name}(${class.name} otherBean) { if (otherBean != null) { #foreach ( $property in $class.properties) this.${property.name} = otherBean.${property.name}; #end } } // ----- Accessors ----- ## **** Generate accessors for attributes **** #foreach ($attribute in $class.attributes) /// <summary> $attribute.getDocumentation(" /// ") /// </summary> $attribute.visibility $attribute.getterSetterTypeName ${stringUtils.upperCamelCaseName($attribute.name)} { get { return $attribute.name; } set { this.$attribute.name = value; } } #end ## **** Generate accessors for associations **** #foreach ($associationEnd in $class.associationEnds) #set ($target = $associationEnd.otherEnd) #if ($target.navigable) /// <summary> $target.getDocumentation(" /// ") /// </summary> public $target.getterSetterTypeName ${stringUtils.upperCamelCaseName($target.name)} { get { return $target.name; } set { this.$target.name = value; } } #end #end // ValueObject.vsl merge-point } #if ($stringUtils.isNotBlank($class.packageName)) } #end 1.1 cartridges/andromda-cs/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1" ?> <namespace name="cs"> <components> <component name="cartridge"> <path>META-INF/andromda/cartridge.xml</path> </component> </components> <properties> <!-- namespace-propertyGroup merge-point --> <propertyGroup name="Outlets"> <documentation> Defines the locations to which output is generated. </documentation> <property name="services" required="false"> <documentation> The directory to which POJO service interfaces are generated. </documentation> </property> <property name="service-impls" required="false"> <documentation> The directory to which POJO service implementation classes are generated </documentation> </property> <property name="value-objects" required="false"> <documentation> The directory to which value objects are generated. </documentation> </property> <property name="exceptions" required="false"> <documentation> The directory to which exceptions are generated. </documentation> </property> <property name="enumerations" required="false"> <documentation> The directory to which enumerations are generated. </documentation> </property> <property name="interfaces" required="false"> <documentation> The directory to which interfaces are generated. </documentation> </property> </propertyGroup> <propertyGroup name="Other"> <property name="serializable"> <default>true</default> <documentation> Indicates whether or not generated objects must support distributed environments. </documentation> </property> <property name="enablePropertyConstructors"> <default>true</default> <documentation> Whether or not constructors taking all properties will be generated or not (on the value object for example). </documentation> </property> </propertyGroup> </properties> </namespace> 1.1 cartridges/andromda-cs/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== <cartridge> <templateObject name="stringUtils" className="org.andromda.utils.StringUtilsHelper"/> <!-- cartridge-templateObject merge-point--> <property reference="serializable"/> <property reference="enablePropertyConstructors"/> <!-- cartridge-property merge-point--> <!-- cartridge-resource merge-point --> <!-- <template path="templates/cs/Service.vsl" outputPattern="{0}/{1}.cs" outlet="services" overwrite="true"> <modelElements variable="service"> <modelElement> <type name="org.andromda.metafacades.uml.Service"/> </modelElement> </modelElements> </template> --> <!-- <template path="templates/cs/ServiceImpl.vsl" outputPattern="{0}/{1}Impl.cs" outlet="service-impls" overwrite="false"> <modelElements variable="service"> <modelElement> <type name="org.andromda.metafacades.uml.Service"/> </modelElement> </modelElements> </template> --> <template path="templates/cs/ValueObject.vsl" outputPattern="{0}/{1}.cs" outlet="value-objects" overwrite="true"> <modelElements variable="class"> <modelElement> <type name="org.andromda.metafacades.uml.ValueObject"/> </modelElement> </modelElements> </template> <!-- <template path="templates/cs/ApplicationException.vsl" outputPattern="{0}/{1}.cs" outlet="exceptions" overwrite="true"> <modelElements variable="class"> <modelElement stereotype="EXCEPTION"/> <modelElement stereotype="APPLICATION_EXCEPTION"/> </modelElements> </template> --> <!-- <template path="templates/cs/UnexpectedException.vsl" outputPattern="{0}/{1}.cs" outlet="exceptions" overwrite="true"> <modelElements variable="class"> <modelElement stereotype="UNEXPECTED_EXCEPTION"/> </modelElements> </template> --> <template path="templates/cs/Enumeration.vsl" outputPattern="{0}/{1}.cs" outlet="enumerations" overwrite="true"> <modelElements variable="enumeration"> <modelElement> <type name="org.andromda.metafacades.uml.EnumerationFacade"/> </modelElement> </modelElements> </template> <!-- <template path="templates/cs/Interface.vsl" outputPattern="{0}/{1}.cs" outlet="interfaces" overwrite="true"> <modelElements variable="interface"> <modelElement> <type name="org.andromda.metafacades.uml.ClassifierFacade"> <property name="interface"/> </type> </modelElement> </modelElements> </template> --> <!-- cartridge-template merge-point --> </cartridge> 1.1 cartridges/andromda-cs/src/main/resources/META-INF/andromda/profile.xml Index: profile.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1" ?> <profile> <elements> <elementGroup name="Stereotypes"> <element name="SERVICE"> <documentation> Produces POJO service classes. This includes both a service interface as well as a service implemention. </documentation> <value>Service</value> <appliedOnElement>class</appliedOnElement> </element> <element name="VALUE_OBJECT"> <documentation> Produces Cs value objects. </documentation> <value>ValueObject</value> <appliedOnElement>class</appliedOnElement> </element> <element name="ENUMERATION"> <documentation> Produces Cs enumeration objects. </documentation> <value>Enumeration</value> <appliedOnElement>class</appliedOnElement> </element> <element name="EXCEPTION"> <documentation> Produces Cs checked exception objects. This will produce the same thing as a classifier stereotyped with <![CDATA[<<ApplicationException>>]]>. </documentation> <value>Exception</value> <appliedOnElement>class</appliedOnElement> </element> <element name="APPLICATION_EXCEPTION"> <documentation> Produces Cs application exception objects. Application exceptions are exceptions that are checked exceptions. These are exceptions that client should be able to catch in order to decide whether or not to take some special action. </documentation> <value>ApplicationException</value> <appliedOnElement>class</appliedOnElement> </element> <element name="UNEXPECTED_EXCEPTION"> <documentation> Produces Cs unexpected exception objects. Unexpected exceptions are unchecked runtime exceptions. These are exceptions that clients shouldn't worry about catching but are thrown when some "unexpected" error in the application flow occurs. </documentation> <value>UnexpectedException</value> <appliedOnElement>class</appliedOnElement> </element> </elementGroup> </elements> </profile> 1.1 cartridges/andromda-cs/src/test/uml/CsCartridgeTestModel.xml.zip <<Binary file>> 1.1 cartridges/andromda-cs/src/main/uml/empty-model.xmi Index: empty-model.xmi =================================================================== <?xml version='1.0' encoding='UTF-8'?> <!-- <!DOCTYPE XMI SYSTEM "uml14xmi12.dtd"> --> <XMI xmi.version='1.2' timestamp='Mon Aug 29 07:45:39 MDT 2005' xmlns:UML='omg.org/UML/1.4'> <XMI.header> <XMI.documentation> <XMI.exporter>MagicDraw UML</XMI.exporter> <XMI.exporterVersion>9.0</XMI.exporterVersion> </XMI.documentation> <XMI.metamodel xmi.name='UML' xmi.version='1.4'/> </XMI.header> <XMI.content> <UML:Model xmi.id='eee_1045467100313_135436_1' name='Data' isRoot='false' isLeaf='false' isAbstract='false'> <UML:ModelElement.comment> <UML:Comment xmi.id='_24400562_1092013275546_280654_0' name='Author:Administrator. Created:8/8/04 8:58 PM. Title:. Comment:. '/> </UML:ModelElement.comment> <XMI.extension xmi.extender='MagicDraw UML 9.0' xmi.extenderID='MagicDraw UML 9.0'> <ignoredInModule xmi.value='true'/> </XMI.extension> <UML:Namespace.ownedElement> <UML:Package xmi.id='eee_1045467100313_365297_7' name='Component View' isRoot='false' isLeaf='false' isAbstract='false'/> <UML:Package href='andromda-profile-3.2-RC1-SNAPSHOT.xml.zip|_8a70287_1078771814628_224704_589'> <XMI.extension xmi.extender='MagicDraw UML 9.0' xmi.extenderID='MagicDraw UML 9.0'> <referentPath xmi.value='::org.andromda.profile'/> </XMI.extension> </UML:Package> <UML:Package xmi.id='_9_0_2_12ab03bf_1125323139546_169312_1' name='Data types' isRoot='false' isLeaf='false' isAbstract='false'/> </UML:Namespace.ownedElement> </UML:Model> </XMI.content> <XMI.extensions xmi.extender='MagicDraw UML 9.0'> <mdOwnedDiagrams/> <options> <mdElement elementClass='SimpleStyle'> <name>Default</name> <default xmi.value='false'/> <mdElement elementClass='PropertyManager'> <name>PROJECT_GENERAL_PROPERTIES</name> <propertyManagerID>_9_0_2_12ab03bf_1125323139546_785253_2</propertyManagerID> <mdElement elementClass='ModelElementProperty'> <propertyID>DEFAULT_PROFILE_PACKAGE</propertyID> <displayableTypes xmi.value='Subsystem^ModelPackage^Model'/> <selectableTypes xmi.value='Subsystem^ModelPackage^Model'/> <useUnspecified xmi.value='true'/> <parentApplicant xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_PROFILE_PACKAGE_SELECTION_DIALOG</propertyID> <propertyDescriptionID>SHOW_PROFILE_PACKAGE_SELECTION_DIALOG_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ClassPathListProperty'> <propertyID>MODULES_DIRS</propertyID> <propertyDescriptionID>MODULES_DIRS_DESCRIPTION</propertyDescriptionID> <mdElement elementClass='FileProperty'> <value><install.root>\profiles</value> <selectionMode xmi.value='0'/> </mdElement> <mdElement elementClass='FileProperty'> <value>C:\Documents and Settings\Administrator\.maven\repository\andromda\xml.zips</value> <selectionMode xmi.value='0'/> </mdElement> <mdElement elementClass='FileProperty'> <value>C:\Documents and Settings\Administrator\.maven\repository\andromda\xml.zips</value> <selectionMode xmi.value='0'/> </mdElement> <mdElement elementClass='FileProperty'> <value>C:\Documents and Settings\Administrator\.maven\repository\andromda\xml.zips\</value> <selectionMode xmi.value='0'/> </mdElement> <mdElement elementClass='FileProperty'> <value>C:\Documents and Settings\cbrandon\.maven\repository\andromda\xml.zips\</value> <selectionMode xmi.value='0'/> </mdElement> <mdElement elementClass='FileProperty'> <value>C:\Documents and Settings\ZOO\.maven\repository\andromda\xml.zips\</value> <selectionMode xmi.value='0'/> </mdElement> <mdElement elementClass='FileProperty'> <value>C:\Documents and Settings\cwbrandon\.maven\repository\andromda\xml.zips\</value> <selectionMode xmi.value='0'/> </mdElement> <value xmi.value='false'/> </mdElement> </mdElement> <mdElement elementClass='PropertyManager'> <name>PROJECT_INVISIBLE_PROPERTIES</name> <propertyManagerID>_9_0_2_12ab03bf_1125323139546_578921_3</propertyManagerID> <mdElement elementClass='NumberProperty'> <propertyID>TOOL_TIP_STYLE</propertyID> <propertyDescriptionID>TOOL_TIP_STYLE_DESCRIPTION</propertyDescriptionID> <value xmi.value='0.0'/> <type xmi.value='0'/> <lowRange xmi.value='0.0'/> <highRange xmi.value='2.0'/> </mdElement> <mdElement elementClass='NumberProperty'> <propertyID>LAST_INTERFACE_STYLE</propertyID> <propertyDescriptionID>LAST_INTERFACE_STYLE_DESCRIPTION</propertyDescriptionID> <value xmi.value='2.0'/> <type xmi.value='0'/> <lowRange xmi.value='0.0'/> <highRange xmi.value='1.0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>IS_BROWSER_VISIBLE</propertyID> <propertyDescriptionID>IS_BROWSER_VISIBLE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>BROWSER_ITEM_TYPES</propertyID> <propertyDescriptionID>BROWSER_ITEM_TYPES_DESCRIPTION</propertyDescriptionID> <choice xmi.value=''/> <index xmi.value='-1'/> </mdElement> <mdElement elementClass='NumberProperty'> <propertyID>BROWSER_DIVIDER_LOCATION</propertyID> <propertyDescriptionID>BROWSER_DIVIDER_LOCATION_DESCRIPTION</propertyDescriptionID> <value xmi.value='-1.0'/> <type xmi.value='0'/> <lowRange xmi.value='-1.0'/> <highRange xmi.value='2.147483647E9'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>BROWSER_BOUNDS</propertyID> <propertyDescriptionID>BROWSER_BOUNDS_DESCRIPTION</propertyDescriptionID> <choice xmi.value=''/> <index xmi.value='-1'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>IS_DOCS_TAB_VISIBLE</propertyID> <propertyDescriptionID>IS_DOCS_TAB_VISIBLE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='StringProperty'> <propertyID>BROWSER_LAYOUT</propertyID> <propertyDescriptionID>BROWSER_LAYOUT_DESCRIPTION</propertyDescriptionID> <value>0 13 0 0 0 a9 0 0 0 a 0 0 6 9 0 0 4 48 0 0 0 0 0 0 0 9 0 0 0 d 0 44 0 4f 0 43 0 55 0 4d 0 45 0 4e 0 54 0 41 0 54 0 49 0 4f 0 4e 0 0 c4 c8 0 0 0 8 0 0 0 1 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 c4 c8 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 dc ec 0 0 0 3 0 0 1e 18 0 0 c4 c8 0 0 2f 10 0 0 0 2 0 0 9a e 0 0 dc ec 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 d 0 44 0 49 0 41 0 47 0 52 0 41 0 4d 0 53 0 5f 0 54 0 52 0 45 0 45 0 0 69 7a 0 0 0 8 0 0 0 0 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 69 7a 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 a8 f6 0 0 0 5 0 0 e9 bd 0 0 a4 ff 0 0 69 7a 0 0 20 c0 0 0 ff 29 0 0 0 2 0 0 9a e 0 0 a8 f6 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 c 0 5a 0 4f 0 4f 0 4d 0 5f 0 43 0 4f 0 4e 0 54 0 52 0 4f 0 4c 0 0 1e 18 0 0 0 8 0 0 0 1 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 1e 18 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 dc ec 0 0 0 3 0 0 1e 18 0 0 c4 c8 0 0 2f 10 0 0 0 2 0 0 9a e 0 0 dc ec 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f 0 45 0 58 0 54 0 45 0 4e 0 53 0 49 0 4f 0 4e 0 53 0 5f 0 54 0 52 0 45 0 45 0 0 20 c0 0 0 0 8 0 0 0 0 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 20 c0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 a8 f6 0 0 0 5 0 0 e9 bd 0 0 a4 ff 0 0 69 7a 0 0 20 c0 0 0 ff 29 0 0 0 2 0 0 9a e 0 0 a8 f6 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 49 0 4e 0 48 0 45 0 52 0 49 0 54 0 41 0 4e 0 43 0 45 0 5f 0 54 0 52 0 45 0 45 0 0 a4 ff 0 0 0 8 0 0 0 0 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 a4 ff 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 a8 f6 0 0 0 5 0 0 e9 bd 0 0 a4 ff 0 0 69 7a 0 0 20 c0 0 0 ff 29 0 0 0 2 0 0 9a e 0 0 a8 f6 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 0 53 0 45 0 41 0 52 0 43 0 48 0 5f 0 52 0 45 0 53 0 55 0 4c 0 54 0 53 0 5f 0 54 0 52 0 45 0 45 0 0 ff 29 0 0 0 8 0 0 0 0 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 ff 29 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 a8 f6 0 0 0 5 0 0 e9 bd 0 0 a4 ff 0 0 69 7a 0 0 20 c0 0 0 ff 29 0 0 0 2 0 0 9a e 0 0 a8 f6 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f 0 4d 0 45 0 53 0 53 0 41 0 47 0 45 0 53 0 5f 0 57 0 49 0 4e 0 44 0 4f 0 57 0 0 c8 a6 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 f 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 c8 a6 0 0 0 0 0 0 0 3c 0 0 0 3c 0 0 0 c8 0 0 0 c8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a 0 50 0 52 0 4f 0 50 0 45 0 52 0 54 0 49 0 45 0 53 0 0 2f 10 0 0 0 8 0 0 0 1 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 2f 10 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 dc ec 0 0 0 3 0 0 1e 18 0 0 c4 c8 0 0 2f 10 0 0 0 2 0 0 9a e 0 0 dc ec 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 43 0 4f 0 4e 0 54 0 41 0 49 0 4e 0 4d 0 45 0 4e 0 54 0 5f 0 54 0 52 0 45 0 45 0 0 e9 bd 0 0 0 8 0 0 0 0 0 0 0 1 0 0 0 f 0 0 0 4 0 0 0 4 0 0 0 8 0 0 1 bc 0 0 1 b2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 4 0 0 e9 bd 0 0 0 2 0 0 0 0 0 0 0 0 0 0 6 1 0 0 3 9c 0 0 0 8 0 0 0 0 0 0 a8 f6 0 0 0 5 0 0 e9 bd 0 0 a4 ff 0 0 69 7a 0 0 20 c0 0 0 ff 29 0 0 0 2 0 0 9a e 0 0 a8 f6 0 0 0 0 0 0 0 2 0 0 a8 f6 0 0 dc ec 0 0 e7 b1 0 0 9a e 0 0 0 1 0 0 0 2 0 0 9a e ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 63 0 0 0 0 0 0 a7 30 0 0 0 1 0 0 4 63 0 0 0 1 0 0 e7 b1 0 0 0 2 0 0 4 63 0 0 0 0 0 0 9a e 0 0 0 2 0 0 4 64 0 0 a8 f6 0 0 0 5 0 0 4 65 0 0 0 10 0 43 0 4f 0 4e 0 54 0 41 0 49 0 4e 0 4d 0 45 0 4e 0 54 0 5f 0 54 0 52 0 45 0 45 0 0 4 65 0 0 0 10 0 49 0 4e 0 48 0 45 0 52 0 49 0 54 0 41 0 4e 0 43 0 45 0 5f 0 54 0 52 0 45 0 45 0 0 4 65 0 0 0 d 0 44 0 49 0 41 0 47 0 52 0 41 0 4d 0 53 0 5f 0 54 0 52 0 45 0 45 0 0 4 65 0 0 0 f 0 45 0 58 0 54 0 45 0 4e 0 53 0 49 0 4f 0 4e 0 53 0 5f 0 54 0 52 0 45 0 45 0 0 4 65 0 0 0 13 0 53 0 45 0 41 0 52 0 43 0 48 0 5f 0 52 0 45 0 53 0 55 0 4c 0 54 0 53 0 5f 0 54 0 52 0 45 0 45 0 0 1 bc 0 0 1 55 0 0 0 0 0 0 4 64 0 0 dc ec 0 0 0 3 0 0 4 65 0 0 0 c 0 5a 0 4f 0 4f 0 4d 0 5f 0 43 0 4f 0 4e 0 54 0 52 0 4f 0 4c 0 0 4 65 0 0 0 d 0 44 0 4f 0 43 0 55 0 4d 0 45 0 4e 0 54 0 41 0 54 0 49 0 4f 0 4e 0 0 4 65 0 0 0 a 0 50 0 52 0 4f 0 50 0 45 0 52 0 54 0 49 0 45 0 53 0 0 1 bc 0 0 1 55 0 0 0 0 0 0 1 bc 0 0 2 ae 0 0 4 66 0 0 0 1 0 0 0 2a 0 0 0 0 0 0 1 c1 0 0 2 ae 0 0 1 c1 0 0 2 ae 0 0 0 3 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 f 0 4d 0 45 0 53 0 53 0 41 0 47 0 45 0 53 0 5f 0 57 0 49 0 4e 0 44 0 4f 0 57 </value> <multiline xmi.value='false'/> </mdElement> <mdElement elementClass='StringProperty'> <propertyID>MT_LAST_SELECTED_TRANSFORMATION</propertyID> <propertyDescriptionID>MT_LAST_SELECTED_TRANSFORMATION_DESCRIPTION</propertyDescriptionID> <multiline xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>MT_TRANSFORMATION_IN_PLACE</propertyID> <propertyDescriptionID>MT_TRANSFORMATION_IN_PLACE_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='ModelElementProperty'> <propertyID>MT_DESTINATION_PACKAGE</propertyID> <displayableTypes xmi.value=''/> <selectableTypes xmi.value=''/> <useUnspecified xmi.value='false'/> <parentApplicant xmi.value='false'/> </mdElement> <mdElement elementClass='StringProperty'> <propertyID>MT_LAST_SELECTED_TYPE_MAP_PROFILE</propertyID> <propertyDescriptionID>MT_LAST_SELECTED_TYPE_MAP_PROFILE_DESCRIPTION</propertyDescriptionID> <multiline xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>MT_LAST_SELECTED_TYPE_MAP_PROFILE_DIRECTION</propertyID> <propertyDescriptionID>MT_LAST_SELECTED_TYPE_MAP_PROFILE_DIRECTION_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>DIAGRAM_INFO_CUSTOM_MODE</propertyID> <propertyDescriptionID>DIAGRAM_INFO_CUSTOM_MODE_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>DIAGRAM_INFO_SELECTED_KEYWORDS</propertyID> <propertyDescriptionID>DIAGRAM_INFO_SELECTED_KEYWORDS_DESCRIPTION</propertyDescriptionID> <choice xmi.value='Diagram name^Author^Creation date^Modification date'/> <index xmi.value='-1'/> </mdElement> <mdElement elementClass='StringProperty'> <propertyID>DIAGRAM_INFO_CUSTOM_HTML</propertyID> <propertyDescriptionID>DIAGRAM_INFO_CUSTOM_HTML_DESCRIPTION</propertyDescriptionID> <multiline xmi.value='false'/> </mdElement> <mdElement elementClass='StringProperty'> <propertyID>INFO_PROPERTY</propertyID> <propertyDescriptionID>INFO_PROPERTY_DESCRIPTION</propertyDescriptionID> <value>6e 5d 28 35 73 2 60 34 73 4 3c c5 9b ae 69 e8 fb 24 3 41 e2 82 b6 c4 91 7c 67 a4 ad 9e 96 4 13 83 60 f7 eb 71 3e 7b 4e 53 f2 6c e5 4a 10 5d 57 13 8a a5 f5 4d 57 85 cc dc f3 62 6b eb 57 e1 67 1f 3f 81 8e 59 </value> <multiline xmi.value='false'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>RECENT_DIAGRAMS</propertyID> <propertyDescriptionID>RECENT_DIAGRAMS_DESCRIPTION</propertyDescriptionID> <choice xmi.value='_9_0_2_12ab03bf_1125323135453_663777_0'/> <index xmi.value='-1'/> </mdElement> </mdElement> </mdElement> <favoriteElements xmi.value=''/> </options> <componentView> <UML:Package xmi.idref='eee_1045467100313_365297_7'/> </componentView> <dataTypes> <UML:Package xmi.idref='_9_0_2_12ab03bf_1125323139546_169312_1'/> </dataTypes> <hasSharedPackages xmi.value='false'/> <mdElement elementClass='StyleManager'> <mdElement elementClass='SimpleStyle'> <name>Default</name> <default xmi.value='true'/> <mdElement elementClass='ExtendableManager'> <removable xmi.value='false'/> <extendableByDiagram xmi.value='true'/> <extendableByStereotype xmi.value='false'/> <name>Abstraction</name> <propertyManagerID>_9_0_2_12ab03bf_1125323139546_17107_4</propertyManagerID> <parentPropertyManager>_9_0_2_12ab03bf_1125323139546_659427_5</parentPropertyManager> <mdElement elementClass='ColorProperty'> <propertyID>STEREOTYPE_COLOR</propertyID> <propertyDescriptionID>STEREOTYPE_COLOR_DESCRIPTION</propertyDescriptionID> <value xmi.value='-16777216'/> </mdElement> <mdElement elementClass='FontProperty'> <propertyID>STEREOTYPE_FONT</propertyID> <propertyDescriptionID>STEREOTYPE_FONT_DESCRIPTION</propertyDescriptionID> <fontName>SansSerif</fontName> <size xmi.value='12'/> <style xmi.value='0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>WRAP_WORDS</propertyID> <propertyDescriptionID>WRAP_WORDS_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_NAME</propertyID> <propertyDescriptionID>SHOW_NAME_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_STEREOTYPE</propertyID> <propertyDescriptionID>SHOW_STEREOTYPE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_TAGGED_VALUES</propertyID> <propertyDescriptionID>SHOW_TAGGED_VALUES_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_CONSTRAINTS</propertyID> <propertyDescriptionID>SHOW_CONSTRAINTS_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>CONSTRAINT_TEXT_MODE</propertyID> <propertyDescriptionID>CONSTRAINT_TEXT_MODE_DESCRIPTION</propertyDescriptionID> <value>EXPRESSION_MODE</value> <choice xmi.value='NAME_MODE^EXPRESSION_MODE'/> <index xmi.value='1'/> </mdElement> </mdElement> <mdElement elementClass='ExtendableManager'> <removable xmi.value='false'/> <extendableByDiagram xmi.value='true'/> <extendableByStereotype xmi.value='false'/> <name>Action State</name> <propertyManagerID>_9_0_2_12ab03bf_1125323139546_948652_6</propertyManagerID> <parentPropertyManager>_9_0_2_12ab03bf_1125323139546_106233_7</parentPropertyManager> <mdElement elementClass='BooleanProperty'> <propertyID>SUPPRESS_STATE_ACTIONS</propertyID> <propertyDescriptionID>SUPPRESS_STATE_ACTIONS_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> </mdElement> <mdElement elementClass='ExtendableManager'> <removable xmi.value='false'/> <extendableByDiagram xmi.value='true'/> <extendableByStereotype xmi.value='false'/> <name>Actor</name> <propertyManagerID>_9_0_2_12ab03bf_1125323139546_198142_8</propertyManagerID> <parentPropertyManager>_9_0_2_12ab03bf_1125323139546_106233_7</parentPropertyManager> <mdElement elementClass='ColorProperty'> <propertyID>FILL_COLOR</propertyID> <propertyDescriptionID>FILL_COLOR_DESCRIPTION</propertyDescriptionID> <value xmi.value='-13159'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SUPPRESS_CLASS_OPERATIONS</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SUPPRESS_CLASS_OPERATIONS_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ColorProperty'> <propertyID>OPERATION_COLOR</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>OPERATION_COLOR_DESCRIPTION</propertyDescriptionID> <value xmi.value='-16777176'/> </mdElement> <mdElement elementClass='FontProperty'> <propertyID>OPERATION_FONT</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>OPERATION_FONT_DESCRIPTION</propertyDescriptionID> <fontName>SansSerif</fontName> <size xmi.value='12'/> <style xmi.value='0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_SIGNATURE</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_SIGNATURE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_MORE_SIGN_FOR_OPERATIONS</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_MORE_SIGN_FOR_OPERATIONS_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>SORT_CLASS_OPERATIONS_MODE</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SORT_CLASS_OPERATIONS_MODE_DESCRIPTION</propertyDescriptionID> <value>NO_SORT</value> <choice xmi.value='NO_SORT^BY_NAME^BY_STEREOTYPE^BY_VISIBILITY'/> <index xmi.value='0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_VISIBILITY</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_VISIBILITY_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_STEREOTYPE</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_STEREOTYPE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_PROPERTIES</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_PROPERTIES_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_CONSTRAINTS</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_CONSTRAINTS_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_PARAMETERS_DIRECTION_KIND</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_PARAMETERS_DIRECTION_KIND_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_FULL_TYPE</propertyID> <propertyDescriptionID>SHOW_FULL_TYPE_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SUPPRESS_CLASS_ATTRIBUTES</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SUPPRESS_CLASS_ATTRIBUTES_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ColorProperty'> <propertyID>ATTRIBUTE_COLOR</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>ATTRIBUTE_COLOR_DESCRIPTION</propertyDescriptionID> <value xmi.value='-14155776'/> </mdElement> <mdElement elementClass='FontProperty'> <propertyID>ATTRIBUTE_FONT</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>ATTRIBUTE_FONT_DESCRIPTION</propertyDescriptionID> <fontName>SansSerif</fontName> <size xmi.value='12'/> <style xmi.value='0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_MORE_SIGN_FOR_ATTRIBUTES</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SHOW_MORE_SIGN_FOR_ATTRIBUTES_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>SORT_CLASS_ATTRIBUTES_MODE</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SORT_CLASS_ATTRIBUTES_MODE_DESCRIPTION</propertyDescriptionID> <value>NO_SORT</value> <choice xmi.value='NO_SORT^BY_NAME^BY_STEREOTYPE^BY_VISIBILITY'/> <index xmi.value='0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_ATTRIBUTES_VISIBILITY</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SHOW_ATTRIBUTES_VISIBILITY_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_ATTRIBUTES_STEREOTYPE</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SHOW_ATTRIBUTES_STEREOTYPE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_ATTRIBUTES_PROPERTIES</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SHOW_ATTRIBUTES_PROPERTIES_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_ATTRIBUTES_CONSTRAINTS</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SHOW_ATTRIBUTES_CONSTRAINTS_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_INIT_VALUE</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SHOW_INIT_VALUE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> </mdElement> <mdElement elementClass='ExtendableManager'> <removable xmi.value='false'/> <extendableByDiagram xmi.value='true'/> <extendableByStereotype xmi.value='false'/> <name>Artifact</name> <propertyManagerID>_9_0_2_12ab03bf_1125323139546_878131_9</propertyManagerID> <parentPropertyManager>_9_0_2_12ab03bf_1125323139546_106233_7</parentPropertyManager> <mdElement elementClass='ColorProperty'> <propertyID>FILL_COLOR</propertyID> <propertyDescriptionID>FILL_COLOR_DESCRIPTION</propertyDescriptionID> <value xmi.value='-13159'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SUPPRESS_CLASS_OPERATIONS</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SUPPRESS_CLASS_OPERATIONS_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ColorProperty'> <propertyID>OPERATION_COLOR</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>OPERATION_COLOR_DESCRIPTION</propertyDescriptionID> <value xmi.value='-16777176'/> </mdElement> <mdElement elementClass='FontProperty'> <propertyID>OPERATION_FONT</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>OPERATION_FONT_DESCRIPTION</propertyDescriptionID> <fontName>SansSerif</fontName> <size xmi.value='12'/> <style xmi.value='0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_SIGNATURE</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_SIGNATURE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_MORE_SIGN_FOR_OPERATIONS</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_MORE_SIGN_FOR_OPERATIONS_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ChoiceProperty'> <propertyID>SORT_CLASS_OPERATIONS_MODE</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SORT_CLASS_OPERATIONS_MODE_DESCRIPTION</propertyDescriptionID> <value>NO_SORT</value> <choice xmi.value='NO_SORT^BY_NAME^BY_STEREOTYPE^BY_VISIBILITY'/> <index xmi.value='0'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_VISIBILITY</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_VISIBILITY_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_STEREOTYPE</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_STEREOTYPE_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_PROPERTIES</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_PROPERTIES_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_CONSTRAINTS</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_CONSTRAINTS_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_OPERATIONS_PARAMETERS_DIRECTION_KIND</propertyID> <propertyGroup>OPERATIONS</propertyGroup> <propertyDescriptionID>SHOW_OPERATIONS_PARAMETERS_DIRECTION_KIND_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SHOW_FULL_TYPE</propertyID> <propertyDescriptionID>SHOW_FULL_TYPE_DESCRIPTION</propertyDescriptionID> <value xmi.value='false'/> </mdElement> <mdElement elementClass='BooleanProperty'> <propertyID>SUPPRESS_CLASS_ATTRIBUTES</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>SUPPRESS_CLASS_ATTRIBUTES_DESCRIPTION</propertyDescriptionID> <value xmi.value='true'/> </mdElement> <mdElement elementClass='ColorProperty'> <propertyID>ATTRIBUTE_COLOR</propertyID> <propertyGroup>ATTRIBUTES</propertyGroup> <propertyDescriptionID>ATTRIBUTE_COLOR_DESCRIPTION</propertyDescriptionID> <value xmi.value='-14155776'/> </mdElement> <mdElement elementClass='FontProperty'> <propertyID>ATTRI... [truncated message content] |
From: Vance K. <va...@us...> - 2006-03-07 15:02:29
|
User: vancek Date: 06/03/07 07:01:35 Modified: andromda-ejb3/src/site/xdoc howto3.xml Log: added info on setting up additional persistence contexts Revision Changes Path 1.4 +34 -0 cartridges/andromda-ejb3/src/site/xdoc/howto3.xml Index: howto3.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/xdoc/howto3.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- howto3.xml 3 Mar 2006 15:28:15 -0000 1.3 +++ howto3.xml 7 Mar 2006 15:01:33 -0000 1.4 @@ -219,6 +219,40 @@ the persistence context annotation, you need to model the above tagged values on this new class. </p> + <p> + The following example shows a new persistence context <code>securityEntityManager</code>. + </p> + <p> + <img src="images/org/andromda/test/3/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="gen"><a href="src/org/andromda/test/howto3/b/CarEmbeddable.java.txt"><code>CarEmbeddable.java</code></a></li> + <li class="impl"><a href="src/org/andromda/test/howto3/b/Car.java.txt"><code>Car.java</code></a></li> + <li class="gen"><a href="src/org/andromda/test/howto3/b/PersonEmbeddable.java.txt"><code>PersonEmbeddable.java</code></a></li> + <li class="impl"><a href="src/org/andromda/test/howto3/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 class="changed" href="src/org/andromda/test/howto3/b/RentalServiceBean.java.txt"><code>RentalServiceBean.java</code></a></li> + <li class="gen"><a href="src/org/andromda/test/howto3/b/RentalServiceRemote.java.txt"><code>RentalServiceRemote.java</code></a></li> + <li class="gen"><a href="src/org/andromda/test/howto3/b/RentalServiceDelegate.java.txt"><code>RentalServiceDelegate.java</code></a></li> + <li class="impl"><a href="src/org/andromda/test/howto3/b/RentalServiceBeanImpl.java.txt"><code>RentalServiceBeanImpl.java</code></a></li> + <li class="gen"><a href="src/org/andromda/test/howto3/b/RentalServiceException.java.txt"><code>RentalServiceException.java</code></a></li> + <li class="gen"><a class="changed" href="src/org/andromda/test/howto3/b/persistence.xml.txt"><code>persistence.xml</code></a></li> + </ul> + </p> + <p> + Notice that <code>SecondaryEntityManager</code> has defined the + <code>@andromda.service.persistence.context.datasource</code> tagged value specifiying the + JNDI name of the JDBC datasource used in this persistence context. You can specify this tag + on a class where the <![CDATA[<<PersistenceContext>>]]> stereotype has been modelled. + </p> </subsection> <a name="EJB_Injections"/> <subsection name="EJB Injections"> |
From: Vance K. <va...@us...> - 2006-03-07 15:00:10
|
User: vancek Date: 06/03/07 06:59:21 Added: andromda-ejb3/src/site/resources/images/org/andromda/test/3/b uml.gif Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/site/resources/images/org/andromda/test/3/b/uml.gif <<Binary file>> |
From: Vance K. <va...@us...> - 2006-03-07 15:00:04
|
User: vancek Date: 06/03/07 06:59:06 cartridges/andromda-ejb3/src/site/resources/images/org/andromda/test/3/b - New directory |
From: Vance K. <va...@us...> - 2006-03-07 09:54:19
|
User: vancek Date: 06/03/07 01:54:19 Modified: andromda-ejb3/src/main/resources/templates/ejb3 persistence.xml.vsl Log: extra persistence contexts defined Revision Changes Path 1.5 +48 -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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- persistence.xml.vsl 28 Feb 2006 02:14:53 -0000 1.4 +++ persistence.xml.vsl 7 Mar 2006 09:54:18 -0000 1.5 @@ -50,4 +50,52 @@ #end </properties> </persistence-unit> +#foreach ($persistenceContext in $persistenceContexts) + <persistence-unit name="${persistenceContext.unitName}"> +#**##if ($stringUtils.isNotBlank($entityManagerJTADataSource)) + <jta-data-source>${persistenceContext.datasource}</jta-data-source> +#**##end + <properties> +#**##if ($stringUtils.isNotBlank($hibernateHbm2DDLAuto)) + <property name="hibernate.hbm2ddl.auto" value="${hibernateHbm2DDLAuto}"/> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateShowSql)) + <property name="hibernate.show_sql" value="${hibernateShowSql}"/> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateDialect)) + <property name="hibernate.dialect" value="${hibernateDialect}"/> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateMaxFetchDepth)) + <property name="hibernate.max_fetch_depth">$hibernateMaxFetchDepth</property> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateJdbcFetchSize)) + <property name="hibernate.jdbc.fetch_size">$hibernateJdbcFetchSize</property> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateJdbcBatchSize)) + <property name="hibernate.jdbc.batch_size">$hibernateJdbcBatchSize</property> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateJdbcUseScrollableResultSet)) + <property name="hibernate.jdbc.use_scrollable_resultset">$hibernateJdbcUseScrollableResultSet</property> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateJdbcUseStreamsForBinary)) + <property name="hibernate.jdbc.use_streams_for_binary">$hibernateJdbcUseStreamsForBinary</property> +#**##end +#**##if ($stringUtils.isNotBlank($hibernateCacheProvider)) + <property name="hibernate.cache.provider_class" value="${hibernateCacheProvider}"/> +#**##end +#**##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 +#**##if ($stringUtils.isNotBlank($hibernateTransactionAutoCloseSession)) + <property name="hibernate.transaction.auto_close_session" value="${hibernateTransactionAutoCloseSession}"/> +#**##end + </properties> + </persistence-unit> +#end </persistence> \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-03-07 09:24:39
|
User: vancek Date: 06/03/07 01:24:39 Modified: andromda-ejb3/src/main/uml EJB3MetafacadeModel.xml.zip Log: added EJB3PersistenceContextFacade extending ClassifierFacade Revision Changes Path 1.23 +191 -170 cartridges/andromda-ejb3/src/main/uml/EJB3MetafacadeModel.xml.zip <<Binary file>> |
From: Vance K. <va...@us...> - 2006-03-07 09:23:51
|
User: vancek Date: 06/03/07 01:23:47 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3SessionFacadeLogicImpl.java Log: removed isAssignableFrom check in the implementation of getPersistenceContextReferences Revision Changes Path 1.13 +8 -2 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.12 retrieving revision 1.13 diff -u -w -r1.12 -r1.13 --- EJB3SessionFacadeLogicImpl.java 22 Feb 2006 06:16:50 -0000 1.12 +++ EJB3SessionFacadeLogicImpl.java 7 Mar 2006 09:23:46 -0000 1.13 @@ -493,10 +493,16 @@ { ModelElementFacade targetElement = ((DependencyFacade)object).getTargetElement(); return (targetElement != null - && EJB3SessionFacade.class.isAssignableFrom(targetElement.getClass()) && targetElement.hasStereotype(EJB3Profile.STEREOTYPE_PERSISTENCE_CONTEXT)); } }); + CollectionUtils.transform(references, new Transformer() + { + public Object transform(final Object object) + { + return ((DependencyFacade)object).getTargetElement(); + } + }); return references; } |
From: Vance K. <va...@us...> - 2006-03-07 09:22:23
|
User: vancek Date: 06/03/07 01:22:23 Added: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3PersistenceContextFacadeLogicImpl.java Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3PersistenceContextFacadeLogicImpl.java Index: EJB3PersistenceContextFacadeLogicImpl.java =================================================================== package org.andromda.cartridges.ejb3.metafacades; import org.andromda.cartridges.ejb3.EJB3Profile; /** * MetafacadeLogic implementation for org.andromda.cartridges.ejb3.metafacades.EJB3PersistenceContextFacade. * * @see org.andromda.cartridges.ejb3.metafacades.EJB3PersistenceContextFacade */ public class EJB3PersistenceContextFacadeLogicImpl extends EJB3PersistenceContextFacadeLogic { public EJB3PersistenceContextFacadeLogicImpl (Object metaObject, String context) { super (metaObject, context); } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3PersistenceContextFacade#getUnitName() */ protected java.lang.String handleGetUnitName() { return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_UNIT_NAME); } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3PersistenceContextFacade#getContextType() */ protected java.lang.String handleGetContextType() { return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_TYPE); } /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3PersistenceContextFacadeLogic#handleGetDatasource() */ protected String handleGetDatasource() { return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_DATASOURCE); } } |
From: Vance K. <va...@us...> - 2006-03-07 09:22:04
|
User: vancek Date: 06/03/07 01:22:02 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java Log: declared TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_DATASOURCE Revision Changes Path 1.17 +7 -0 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Profile.java Index: EJB3Profile.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Profile.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -r1.16 -r1.17 --- EJB3Profile.java 5 Mar 2006 05:59:40 -0000 1.16 +++ EJB3Profile.java 7 Mar 2006 09:22:01 -0000 1.17 @@ -388,6 +388,13 @@ profile.get("SERVICE_PERSISTENCE_CONTEXT_TYPE"); /** + * The tagged value representing the persistence context + * datasource JNDI name + */ + public static final String TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_DATASOURCE = + profile.get("SERVICE_PERSISTENCE_CONTEXT_DATASOURCE"); + + /** * The tagged value representing the flush mode on bean operation. */ public static final String TAGGEDVALUE_EJB_PERSISTENCE_FLUSH_MODE = profile.get("SERVICE_PERSISTENCE_FLUSH_MODE"); |