From: Vance K. <va...@us...> - 2006-04-24 02:21:46
|
User: vancek Date: 06/04/23 19:21:43 Added: andromda-ejb3/src/main/resources/templates/ejb3 DaoImpl.vsl DaoBase.vsl DaoLocal.vsl DaoDefaultException.vsl Log: added DAO layer support - inline with spring cartridge Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/DaoImpl.vsl Index: DaoImpl.vsl =================================================================== #set ($generatedFile = "${entity.packagePath}/${entity.daoImplementationName}.java") // license-header java merge-point #if ($entity.daoImplementationRequired) /** * This is only generated once! It will never be overwritten. * You can (and have to!) safely modify it by hand. */ #else // // Attention: Generated code! Do not modify by hand! // Generated by: SessionDaoImpl.vsl in andromda-ejb3-cartridge. // #end #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end #set ($superclass = $entity.generalization) /** * @see $entity.fullyQualifiedName */ public class $entity.daoImplementationName extends $entity.fullyQualifiedDaoBaseName { #foreach ($operation in $entity.daoBusinessOperations) #**##set ($returnType = $operation.returnType) #**##set ($returnObject = "returnValue") #**##set ($signature = $operation.implementationSignature) /** * @see ${entity.fullyQualifiedDaoName}#${operation.getSignature(false)} */ protected $returnType.fullyQualifiedName $signature #**##if ($operation.exceptionsPresent) throws $operation.exceptionList #**##end { // ${toDoTag} implement $operation.visibility $returnType.fullyQualifiedName $signature #**##if ($operation.returnTypePresent) return $operation.returnType.javaNullString; #**##else throw new java.lang.UnsupportedOperationException("${entity.fullyQualifiedName}.${signature} Not implemented!"); #**##end } #end #foreach ($valueObjectRef in $entity.valueObjectReferences) /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationMethodName}($entity.fullyQualifiedEntityName, $valueObjectRef.targetElement.fullyQualifiedName) */ public void ${valueObjectRef.transformationMethodName}( $entity.fullyQualifiedEntityName sourceEntity, $valueObjectRef.targetElement.fullyQualifiedName targetVO) { // ${toDoTag} verify behavior of ${valueObjectRef.transformationMethodName} super.${valueObjectRef.transformationMethodName}(sourceEntity, targetVO); #**##foreach ($property in $valueObjectRef.targetElement.allProperties) #* *##foreach ($entityProp in $entity.allProperties) #* *##if ($property.name == $entityProp.name) #* *##set ($getVal = false) #* *##set ($getVal = $converter.typeConvert($entityProp.type.fullyQualifiedName, "sourceEntity.${entityProp.getterName}()", $property.type.fullyQualifiedName) ) #* *##if (!$getVal) // WARNING! No conversion for targetVO.${property.name} (can't convert sourceEntity.${entityProp.getterName}():${entityProp.type.fullyQualifiedName} to $property.type.fullyQualifiedName #* *##end #* *##end #* *##end #**##end } /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationMethodName}($entity.fullyQualifiedName) */ public $valueObjectRef.targetElement.fullyQualifiedName ${valueObjectRef.transformationMethodName}(final $entity.fullyQualifiedName entity) { // ${toDoTag} verify behavior of ${valueObjectRef.transformationMethodName} return super.${valueObjectRef.transformationMethodName}(entity); } /** * Retrieves the entity object that is associated with the specified value object * from the object store. If no such entity object exists in the object store, * a new, blank entity is created */ private $entity.fullyQualifiedEntityName load${entity.name}From${valueObjectRef.targetElement.name}($valueObjectRef.targetElement.fullyQualifiedName $stringUtils.uncapitalize($valueObjectRef.name)) { // ${toDoTag} implement load${entity.name}From${valueObjectRef.targetElement.name} throw new java.lang.UnsupportedOperationException("${entity.packageName}.load${entity.name}From${valueObjectRef.targetElement.name}($valueObjectRef.targetElement.fullyQualifiedName) not yet implemented."); /* A typical implementation looks like this: $entity.fullyQualifiedEntityName $stringUtils.uncapitalize($entity.name) = this.load(${stringUtils.uncapitalize($valueObjectRef.name)}.getId()); if ($stringUtils.uncapitalize($entity.name) == null) { $stringUtils.uncapitalize($entity.name) = ${entity.fullyQualifiedEntityName}.Factory.newInstance(); } return $stringUtils.uncapitalize($entity.name); */ } /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationToEntityMethodName}($valueObjectRef.targetElement.fullyQualifiedName) */ public $entity.fullyQualifiedEntityName ${valueObjectRef.transformationToEntityMethodName}($valueObjectRef.targetElement.fullyQualifiedName $stringUtils.uncapitalize($valueObjectRef.name)) { // ${toDoTag} verify behavior of ${valueObjectRef.transformationToEntityMethodName} $entity.fullyQualifiedEntityName entity = this.load${entity.name}From${valueObjectRef.targetElement.name}($stringUtils.uncapitalize($valueObjectRef.name)); this.${valueObjectRef.transformationToEntityMethodName}($stringUtils.uncapitalize($valueObjectRef.name), entity, true); return entity; } /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationToEntityMethodName}($valueObjectRef.targetElement.fullyQualifiedName, $entity.fullyQualifiedEntityName) */ public void ${valueObjectRef.transformationToEntityMethodName}( $valueObjectRef.targetElement.fullyQualifiedName sourceVO, $entity.fullyQualifiedEntityName targetEntity, boolean copyIfNull) { // ${toDoTag} verify behavior of ${valueObjectRef.transformationToEntityMethodName} super.${valueObjectRef.transformationToEntityMethodName}(sourceVO, targetEntity, copyIfNull); #**##set ($attributes = $entity.getAttributes(true,false)) #**##foreach ($attribute in $attributes) #* *##foreach ($voProperty in $valueObjectRef.targetElement.allProperties) #* *##if ($attribute.name == $voProperty.name) #* *##set ($getVal = false) #* *##set ($getVal = $converter.typeConvert($voProperty.type.fullyQualifiedName, "sourceVO.${voProperty.getterName}()", $attribute.type.fullyQualifiedName) ) #* *##if (!$getVal) // No conversion for targetEntity.${attribute.name} (can't convert sourceVO.${voProperty.getterName}():${voProperty.type.fullyQualifiedName} to $attribute.type.fullyQualifiedName #* *##end #* *##end #* *##end #**##end } #end } 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/DaoBase.vsl Index: DaoBase.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: SessionDaoBase.vsl in andromda-ejb3-cartridge. // #set ($generatedFile = "${entity.packagePath}/${entity.daoBaseName}.java") #if ($enableTemplating) #**##set ($entityCollectionType = "java.util.Collection<${entity.fullyQualifiedEntityName}>") #else #**##set ($entityCollectionType = "java.util.Collection") #end #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end #set ($daoInheritance = $entity.generalization && $daoInheritanceEnabled) #if ($daoInheritance) #**##set ($rootEntityType = $entity.root.fullyQualifiedEntityName) #**##set ($rootDaoType = $entity.root.fullyQualifiedDaoName) #else #**##set ($rootEntityType = $entity.fullyQualifiedEntityName) #**##set ($rootDaoType = $entity.fullyQualifiedDaoName) #end /** * <p> * Base EJB3 DAO Class: is able to create, update, remove, load, and find * objects of type <code>$entity.fullyQualifiedEntityName</code>. * </p> * * @see $entity.fullyQualifiedEntityName */ @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED) @javax.ejb.Local({${entity.fullyQualifiedDaoName}.class}) public abstract class $entity.daoBaseName #if ($daoInheritance) extends $entity.generalization.fullyQualifiedDaoImplementationName #end implements $entity.fullyQualifiedDaoName { // ------ Session Context Injection ------ @javax.annotation.Resource protected javax.ejb.SessionContext context; // ------ Persistence Context Injection -------- /** * Inject persistence context #if ($entity.defaultPersistenceContextUnitName)${entity.defaultPersistenceContextUnitName}#end */ @javax.persistence.PersistenceContext#if ($entity.defaultPersistenceContextUnitName)(unitName = "${entity.defaultPersistenceContextUnitName}")#end protected javax.persistence.EntityManager emanager; #foreach($entityRef in $entity.entityReferences) private $entityRef.targetElement.fullyQualifiedDaoName $entityRef.daoName; /** * Sets the reference to <code>$entityRef.daoName</code>. */ public void ${entityRef.daoSetterName}($entityRef.targetElement.fullyQualifiedDaoName $entityRef.daoName) { this.$entityRef.daoName = $entityRef.daoName; } /** * Gets the reference to <code>$entityRef.daoName</code>. */ protected $entityRef.targetElement.fullyQualifiedDaoName ${entityRef.daoGetterName}() { return this.$entityRef.daoName; } #end #set ($identifier = $entity.identifiers.iterator().next()) #set ($argumentName = $stringUtils.uncapitalize($entity.name)) /** * @see ${entity.fullyQualifiedDaoName}#load(int, $identifier.type.fullyQualifiedName) */ public Object load(final int transform, final $identifier.type.fullyQualifiedName $identifier.name) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { #set ($argument = $identifier.name) #if($identifier.type.primitive) #**##set ($argument = "new ${identifier.type.wrapperName}(${identifier.name})") #else if ($argument == null) { throw new IllegalArgumentException( "${entity.name}.load - '$argument' can not be null"); } #end try { final Object entity = (${entity.fullyQualifiedEntityName})emanager.find(${entity.fullyQualifiedEntityName}.class, $argument); return transformEntity(transform, ($entity.fullyQualifiedName)entity); } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } /** * @see ${entity.fullyQualifiedDaoName}#load($identifier.type.fullyQualifiedName) */ public $rootEntityType load($identifier.type.fullyQualifiedName $identifier.name) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { return ($entity.fullyQualifiedEntityName)this.load($entity.daoNoTransformationConstantName, $identifier.name); } /** * @see ${entity.fullyQualifiedDaoName}#loadAll() */ #if ($enableTemplating) @SuppressWarnings({"unchecked"}) #end public $entityCollectionType loadAll() throws ${entity.fullyQualifiedDaoDefaultExceptionName} { return #if ($enableTemplating)($entityCollectionType)#end#**#this.loadAll(TRANSFORM_NONE); } /** * @see ${entity.fullyQualifiedDaoName}#loadAll(int) */ public java.util.Collection loadAll(final int transform) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { try { javax.persistence.Query query = emanager.createQuery("from ${entity.entityName} as entity"); java.util.List<${entity.fullyQualifiedEntityName}> results = query.getResultList(); this.transformEntities(transform, results); return results; } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } ## Only add these methods if the entity isn't abstract #if (!$entity.abstract) /** * @see ${entity.fullyQualifiedDaoName}#create($entity.fullyQualifiedEntityName) */ public $rootEntityType create($entity.fullyQualifiedEntityName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { return ($entity.fullyQualifiedEntityName)this.create($entity.daoNoTransformationConstantName, $argumentName); } /** * @see ${entity.fullyQualifiedDaoName}#create(int transform, $entity.fullyQualifiedEntityName) */ public Object create(final int transform, final $entity.fullyQualifiedName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { if ($argumentName == null) { throw new IllegalArgumentException( "${entity.name}.create - '$argumentName' can not be null"); } try { emanager.persist(${argumentName}); emanager.flush(); return this.transformEntity(transform, $argumentName); } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } /** * @see ${entity.fullyQualifiedDaoName}#create($entityCollectionType) */ #**##if ($enableTemplating) @SuppressWarnings({"unchecked"}) #**##end public $entityCollectionType create(final $entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { return create($entity.daoNoTransformationConstantName, entities); } /** * @see ${entity.fullyQualifiedDaoName}#create(int, $entityCollectionType) */ #**##if ($enableTemplating) @SuppressWarnings({"unchecked"}) #**##end public java.util.Collection create(final int transform, final $entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { if (entities == null) { throw new IllegalArgumentException( "${entity.name}.create - 'entities' can not be null"); } java.util.Collection results = new java.util.ArrayList(); try { for (final java.util.Iterator entityIterator = entities.iterator(); entityIterator.hasNext();) { results.add(create(transform, ($entity.fullyQualifiedEntityName)entityIterator.next())); } } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } return results; } #**##if ($enableDaoPropertiesCreateMethod.equalsIgnoreCase('true')) #* *##set ($attributes = $entity.getAttributes(true, $entity.usingAssignedIdentifier)) #* *##if (!$attributes.empty) /** * @see ${rootDaoType}#create(${entity.getAttributeTypeList(true, false)}) */ public $rootEntityType create( #* *##foreach($attribute in $attributes) $attribute.type.fullyQualifiedName $attribute.name#if($velocityCount != $attributes.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName}#end #* *##end { return ($rootEntityType)this.create($entity.daoNoTransformationConstantName, ${entity.getAttributeNameList(true, $entity.usingAssignedIdentifier)}); } /** * @see ${rootDaoType}#create(int, ${entity.getAttributeTypeList(true, false)}) */ public Object create( final int transform, #* *##foreach($attribute in $attributes) $attribute.type.fullyQualifiedName $attribute.name#if($velocityCount != $attributes.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName}#end #* *##end { $entity.fullyQualifiedEntityName entity = new ${entity.fullyQualifiedEntityName}(); #* *##foreach ($attribute in $attributes) entity.${attribute.setterName}($attribute.name); #* *##end return this.create(transform, entity); } #* *##end #* *##set ($requiredProperties = $entity.getRequiredProperties(true,false)) #* *##if (!$requiredProperties.empty && $entity.getRequiredAttributes(true,false).size() != $requiredProperties.size()) /** * @see ${entity.fullyQualifiedDaoName}#create(${entity.getRequiredPropertyTypeList(true, false)}) */ public $rootEntityType create( #* *##foreach($property in $requiredProperties) $property.getterSetterTypeName $property.name#if($velocityCount != $requiredProperties.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName}#end #* *##end { return ($rootEntityType)this.create($entity.daoNoTransformationConstantName, ${entity.getRequiredPropertyNameList(true,false)}); } /** * @see ${entity.fullyQualifiedDaoName}#create(int, ${entity.getRequiredPropertyTypeList(true, false)}) */ public Object create( final int transform, #* *##foreach($property in $requiredProperties) $property.getterSetterTypeName $property.name#if($velocityCount != $requiredProperties.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName}#end #* *##end { $entity.fullyQualifiedEntityName entity = new ${entity.fullyQualifiedEntityName}(); #* *##foreach ($property in $requiredProperties) entity.${property.setterName}($property.name); #* *##end return this.create(transform, entity); } #* *##end #**##end #end /** * @see ${entity.fullyQualifiedDaoName}#update($entity.fullyQualifiedEntityName) */ public void update($entity.fullyQualifiedEntityName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { if ($argumentName == null) { throw new IllegalArgumentException( "${entity.name}.update - '$argumentName' can not be null"); } try { emanager.merge($argumentName); emanager.flush(); } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } /** * @see ${rootDaoType}#update($entityCollectionType) */ public void update(final $entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { if (entities == null) { throw new IllegalArgumentException( "${entity.name}.update - 'entities' can not be null"); } try { for (final java.util.Iterator entityIterator = entities.iterator(); entityIterator.hasNext();) { update(($entity.fullyQualifiedEntityName)entityIterator.next()); } } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } /** * @see ${entity.fullyQualifiedDaoName}#remove($entity.fullyQualifiedEntityName) */ public void remove($entity.fullyQualifiedEntityName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { if ($argumentName == null) { throw new IllegalArgumentException( "${entity.name}.remove - '$argumentName' can not be null"); } try { emanager.remove($argumentName); emanager.flush(); } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } /** * @see ${entity.fullyQualifiedDaoName}#remove($identifier.type.fullyQualifiedName) */ public void remove($identifier.type.fullyQualifiedName $identifier.name) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { #set ($argument = $identifier.name) #if($identifier.type.primitive) #**##set ($argument = "new ${identifier.type.wrapperName}(${identifier.name})") #else if ($argument == null) { throw new IllegalArgumentException( "${entity.name}.remove - '$identifier.name' can not be null"); } #end #set ($loadCall = "this.load($identifier.name)") #if ($entity.generalization) #**##set ($loadCall = "($entity.fullyQualifiedEntityName)${loadCall}") #end try { final $entity.fullyQualifiedEntityName entity = $loadCall; if (entity != null) { this.remove(entity); } } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } /** * @see ${rootDaoType}#remove($entityCollectionType) */ public void remove($entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName} { if (entities == null) { throw new IllegalArgumentException( "${entity.name}.remove - 'entities' can not be null"); } try { for (final java.util.Iterator entityIterator = entities.iterator(); entityIterator.hasNext();) { remove(($entity.fullyQualifiedEntityName)entityIterator.next()); } } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } #foreach ($finder in $entity.getQueryOperations(true)) #**##set ($returnType = $finder.returnType.fullyQualifiedName) /** * @see ${entity.fullyQualifiedDaoName}#$finder.getSignature(false) */ $finder.visibility $returnType $finder.signature #**##if ($finder.exceptionsPresent) throws $finder.exceptionList, ${entity.fullyQualifiedDaoDefaultExceptionName} #**##else throws ${entity.fullyQualifiedDaoDefaultExceptionName} #**##end { #**##set ($finderCall = "this.${finder.name}($entity.daoNoTransformationConstantName#if(!$finder.arguments.empty), ${finder.argumentNames}#end);") #**##if (!$finder.returnType.collectionType) #* *##set ($finderCall = "($returnType)$finderCall") #**##end return $finderCall } /** * @see ${entity.fullyQualifiedDaoName}#${finder.name}(java.lang.String#if(!$finder.arguments.empty), ${finder.argumentTypeNames}#end) */ $finder.visibility $returnType ${finder.name}(final java.lang.String queryString#if(!$finder.arguments.empty), ${finder.getTypedArgumentList('final')}#end) #**##if ($finder.exceptionsPresent) throws $finder.exceptionList, ${entity.fullyQualifiedDaoDefaultExceptionName} #**##else throws ${entity.fullyQualifiedDaoDefaultExceptionName} #**##end { #**##set ($finderCall = "this.${finder.name}($entity.daoNoTransformationConstantName, queryString#if(!$finder.arguments.empty), ${finder.argumentNames}#end);") #**##if (!$finder.returnType.collectionType) #* *##set ($finderCall = "($returnType)$finderCall") #**##end return $finderCall } #**##if (!$finder.returnType.collectionType) #* *##set ($returnType = "Object") #**##end /** * @see ${entity.fullyQualifiedDaoName}#${finder.name}(int#if(!$finder.arguments.empty), ${finder.argumentTypeNames}#end) */ $finder.visibility $returnType ${finder.name}(final int transform#if(!$finder.arguments.empty), ${finder.getTypedArgumentList('final')}#end) #**##if ($finder.exceptionsPresent) throws $finder.exceptionList, ${entity.fullyQualifiedDaoDefaultExceptionName} #**##else throws ${entity.fullyQualifiedDaoDefaultExceptionName} #**##end { return this.${finder.name}(transform, "$finder.getQuery($entity)"#if(!$finder.arguments.empty), ${finder.argumentNames}#end); } /** * @see ${entity.fullyQualifiedDaoName}#${finder.name}(int, java.lang.String#if(!$finder.arguments.empty), ${finder.argumentTypeNames}#end) */ $finder.visibility $returnType ${finder.name}(final int transform, final java.lang.String queryString#if(!$finder.arguments.empty), ${finder.getTypedArgumentList('final')}#end) #**##if ($finder.exceptionsPresent) throws ${finder.exceptionList}, ${entity.fullyQualifiedDaoDefaultExceptionName} #**##else throws ${entity.fullyQualifiedDaoDefaultExceptionName} #**##end { try { javax.persistence.Query queryObject = emanager.createQuery(queryString); #**##foreach($argument in $finder.arguments) #* *##set ($count = $velocityCount - 1) #* *##set ($argumentValue = $argument.name) #* *##if($argument.type.primitive) #* *##set ($argumentValue = "new ${argument.type.wrapperName}($argument.name)") #* *##elseif ($argument.type.enumeration) #* *##set ($argumentValue = "${argument.name}.getValue()") #* *##end #* *##set ($setParameterOperation = "setParameter") #* *##if ($argument.type.collectionType || $argument.type.arrayType) #* *##set ($setParameterOperation = "${setParameterOperation}List") #* *##end #* *##if ($finder.useNamedParameters) queryObject.${setParameterOperation}("$argument.name", $argumentValue); #* *##else queryObject.${setParameterOperation}($count, $argumentValue); #* *##end #**##end #**##if ($finder.returnType.setType || !$finder.returnType.collectionType) java.util.Set results = new java.util.LinkedHashSet(queryObject.getResultList()); #**##else java.util.List results = queryObject.getResultList(); #**##end #**##if (!$finder.returnType.collectionType) Object result = null; if (results != null) { if (results.size() > 1) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}( "More than one instance of '${finder.returnType.fullyQualifiedName}" + "' was found when executing query --> '" + queryString + "'"); } else if (results.size() == 1) { result = ($entity.fullyQualifiedName)results.iterator().next(); } } result = transformEntity(transform, ($entity.fullyQualifiedName)result); return result; #**##else transformEntities(transform, results); return results; #**##end } catch (Exception ex) { throw new ${entity.fullyQualifiedDaoDefaultExceptionName}(ex); } } #end #foreach ($operation in $entity.daoBusinessOperations) #**##set ($returnType = $operation.returnType) #**##set ($signature = $operation.signature) /** * @see ${entity.fullyQualifiedDaoName}#${operation.getSignature(false)} */ $operation.visibility $returnType.fullyQualifiedName ${operation.name}(${operation.getTypedArgumentList('final')}) #**##if ($operation.exceptionsPresent) throws $operation.exceptionList #**##end { #**##if ($requiredCheckEnabled) #* *##foreach ($argument in $operation.arguments) #* *##if ($argument.required && !$argument.type.primitive) if ($argument.name == null) { throw new IllegalArgumentException( "${entity.fullyQualifiedDaoName}.${operation.signature} - '${argument.name}' can not be null"); } #* *##end #* *##end #**##end try { #**##set ($call = "this.${operation.implementationCall};") #**##if ($operation.returnTypePresent) return $call #**##else $call #**##end } #**##foreach($exception in $operation.exceptions) catch ($exception.fullyQualifiedName ex) { throw ex; } #**##end catch (Throwable th) { throw new java.lang.RuntimeException( "Error performing '${entity.fullyQualifiedDaoName}.${operation.signature}' --> " + th, th); } } /** * Performs the core logic for {@link #${operation.getSignature(false)}} */ protected abstract $operation.returnType.fullyQualifiedName $operation.implementationSignature throws java.lang.Exception; #end /** * Allows transformation of entities into value objects * (or something else for that matter), when the <code>transform</code> * flag is set to one of the constants defined in <code>$entity.fullyQualifiedDaoName</code>, please note * that the {@link #$entity.daoNoTransformationConstantName} constant denotes no transformation, so the entity itself * will be returned. #if (!$entity.valueObjectReferences.empty) * <p/> * This method will return instances of these types: * <ul> * <li>{@link $entity.fullyQualifiedName} - {@link #$entity.daoNoTransformationConstantName}</li> #**##foreach ($valueObjectRef in $entity.valueObjectReferences) #* *##set ($targetElement = $valueObjectRef.targetElement) * <li>{@link $targetElement.fullyQualifiedName} - {@link ${valueObjectRef.transformationConstantName}}</li> #**##end * </ul> #end * * If the integer argument value is unknown {@link #${entity.daoNoTransformationConstantName}} is assumed. * * @param transform one of the constants declared in {@link $entity.fullyQualifiedDaoName} * @param entity an entity that was found * @return the transformed entity (i.e. new value object, etc) * @see #transformEntities(int,java.util.Collection) */ protected Object transformEntity(final int transform, final $entity.fullyQualifiedName entity) { Object target = null; if (entity != null) { switch (transform) { #foreach ($valueObjectRef in $entity.allValueObjectReferences) case ${valueObjectRef.sourceElement.fullyQualifiedDaoName}.${valueObjectRef.transformationConstantName} : target = ${valueObjectRef.transformationMethodName}(entity); break; #end case $entity.daoNoTransformationConstantName : // fall-through default: target = entity; } } return target; } /** * Transforms a collection of entities using the * {@link #transformEntity(int,$entity.fullyQualifiedName)} * method. This method does not instantiate a new collection. * <p/> * This method is to be used internally only. * * @param transform one of the constants declared in <code>$entity.fullyQualifiedDaoName</code> * @param entities the collection of entities to transform * @return the same collection as the argument, but this time containing the transformed entities * @see #transformEntity(int,$entity.fullyQualifiedName) */ protected void transformEntities(final int transform, final java.util.Collection entities) { switch (transform) { #foreach ($valueObjectRef in $entity.allValueObjectReferences) case ${valueObjectRef.sourceElement.fullyQualifiedDaoName}.${valueObjectRef.transformationConstantName} : ${valueObjectRef.transformationToCollectionMethodName}(entities); break; #end case $entity.daoNoTransformationConstantName : // fall-through default: // do nothing; } } #foreach ($valueObjectRef in $entity.valueObjectReferences) /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationToCollectionMethodName}(java.util.Collection) */ public final void ${valueObjectRef.transformationToCollectionMethodName}(java.util.Collection entities) { if (entities != null) { org.apache.commons.collections.CollectionUtils.transform(entities, ${valueObjectRef.transformationAnonymousName}); } } /** * Default implementation for transforming the results of a report query into a value object. This * implementation exists for convenience reasons only. It needs only be overridden in the * {@link $entity.daoImplementationName} class if you intend to use reporting queries. * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationMethodName}($entity.fullyQualifiedName) */ protected $valueObjectRef.targetElement.fullyQualifiedName ${valueObjectRef.transformationMethodName}(Object[] row) { $valueObjectRef.targetElement.fullyQualifiedName target = null; if (row != null) { final int numberOfObjects = row.length; for (int ctr = 0; ctr < numberOfObjects; ctr++) { final Object object = row[ctr]; if (object instanceof $entity.fullyQualifiedEntityName) { target = this.${valueObjectRef.transformationMethodName}(($entity.fullyQualifiedEntityName)object); break; } } } return target; } /** * This anonymous transformer is designed to transform entities or report query results * (which result in an array of objects) to {@link ${valueObjectRef.targetElement.fullyQualifiedName}} * using the Jakarta Commons-Collections Transformation API. */ private org.apache.commons.collections.Transformer $valueObjectRef.transformationAnonymousName = new org.apache.commons.collections.Transformer() { public Object transform(Object input) { Object result = null; if (input instanceof $entity.fullyQualifiedEntityName) { result = ${valueObjectRef.transformationMethodName}(($entity.fullyQualifiedEntityName)input); } else if (input instanceof Object[]) { result = ${valueObjectRef.transformationMethodName}((Object[])input); } return result; } }; /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationToEntityCollectionMethodName}(java.util.Collection) */ public final void ${valueObjectRef.transformationToEntityCollectionMethodName}(java.util.Collection instances) { if (instances != null) { for (final java.util.Iterator iterator = instances.iterator(); iterator.hasNext();) { // - remove an objects that are null or not of the correct instance if (!(iterator.next() instanceof $valueObjectRef.targetElement.fullyQualifiedName)) { iterator.remove(); } } org.apache.commons.collections.CollectionUtils.transform(instances, $valueObjectRef.valueObjectToEntityTransformerName); } } private final org.apache.commons.collections.Transformer $valueObjectRef.valueObjectToEntityTransformerName = new org.apache.commons.collections.Transformer() { public Object transform(Object input) { return ${valueObjectRef.transformationToEntityMethodName}(($valueObjectRef.targetElement.fullyQualifiedName)input); } }; /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationMethodName}($entity.fullyQualifiedEntityName, $valueObjectRef.targetElement.fullyQualifiedName) */ public void ${valueObjectRef.transformationMethodName}( $entity.fullyQualifiedEntityName source, $valueObjectRef.targetElement.fullyQualifiedName target) { #set ($entityProperties = $entity.allProperties) #foreach ($property in $valueObjectRef.targetElement.allProperties) #* *##foreach ($entityProperty in $entityProperties) #* *##if ($property.name.equals($entityProperty.name)) #* *##set ($entityPropertyGetterValue = false) #* *##set ($entityPropertyGetterValue = $converter.typeConvert($entityProperty.type.fullyQualifiedName, "source.${entityProperty.getterName}()", $property.type.fullyQualifiedName)) #* *##if ($entityPropertyGetterValue) target.${property.setterName}($entityPropertyGetterValue); #* *##else // No conversion for target.${property.name} (can't convert source.${entityProperty.getterName}():${entityProperty.type.fullyQualifiedName} to $property.type.fullyQualifiedName) #* *##end #* *##end #* *##end #end } /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationMethodName}($entity.fullyQualifiedName) */ public $valueObjectRef.targetElement.fullyQualifiedName ${valueObjectRef.transformationMethodName}(final $entity.fullyQualifiedName entity) { final $valueObjectRef.targetElement.fullyQualifiedName target = new ${valueObjectRef.targetElement.fullyQualifiedName}(); this.${valueObjectRef.transformationMethodName}(entity, target); return target; } /** * @see ${entity.fullyQualifiedDaoName}#${valueObjectRef.transformationToEntityMethodName}($valueObjectRef.targetElement.fullyQualifiedName, $entity.fullyQualifiedEntityName) */ public void ${valueObjectRef.transformationToEntityMethodName}( $valueObjectRef.targetElement.fullyQualifiedName source, $entity.fullyQualifiedEntityName target, boolean copyIfNull) { #set ($entityAttributes = $entity.getAttributes(true, $entity.usingAssignedIdentifier)) #foreach ($entityProperty in $entityAttributes) #* *##if (!$entityProperty.readOnly) #* *##foreach ($property in $valueObjectRef.targetElement.allProperties) #* *##if ($property.name.equals($entityProperty.name)) #* *##set ($propertyGetterValue = false) #* *##set ($propertyGetterValue = $converter.typeConvert($property.type.fullyQualifiedName, "source.${property.getterName}()", $entityProperty.type.fullyQualifiedName)) #* *##if ($propertyGetterValue) if (copyIfNull || source.${property.getterName}() != $property.type.javaNullString) { target.${entityProperty.setterName}($propertyGetterValue); } #* *##else // No conversion for target.${entityProperty.name} (can't convert source.${property.getterName}():${property.type.fullyQualifiedName} to $entityProperty.type.fullyQualifiedName) #* *##end #* *##end #* *##end #**##end #end } #end } 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/DaoLocal.vsl Index: DaoLocal.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand! // Generated by: SessionDaoLocal.vsl in andromda-ejb3-cartridge. // #set ($generatedFile = "${entity.packagePath}/${entity.daoName}.java") #if ($enableTemplating) #**##set ($entityCollectionType = "java.util.Collection<${entity.fullyQualifiedEntityName}>") #else #**##set ($entityCollectionType = "java.util.Collection") #end #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end #set ($superclass = $entity.generalization) #set ($daoInheritance = $superclass && $daoInheritanceEnabled) #if ($daoInheritance) #**##set ($rootEntityType = $entity.root.fullyQualifiedEntityName) #else #**##set ($rootEntityType = $entity.fullyQualifiedEntityName) #end /** * @see $entity.fullyQualifiedEntityName */ public interface $entity.daoName #if ($daoInheritance) extends $superclass.fullyQualifiedDaoName #end { #if (!$daoInheritance) /** * This constant is used as a transformation flag; entities can be converted automatically into value objects * or other types, different methods in a class implementing this interface support this feature: look for * an <code>int</code> parameter called <code>transform</code>. * <p/> * This specific flag denotes no transformation will occur. */ public final static int $entity.daoNoTransformationConstantName = 0; #end #foreach ($valueObjectRef in $entity.valueObjectReferences) /** * This constant is used as a transformation flag; entities can be converted automatically into value objects * or other types, different methods in a class implementing this interface support this feature: look for * an <code>int</code> parameter called <code>transform</code>. * <p/> * This specific flag denotes entities must be transformed into objects of type * {@link $valueObjectRef.targetElement.fullyQualifiedName}. */ public final static int $valueObjectRef.transformationConstantName = $valueObjectRef.transformationConstantValue; /** * Copies the fields of the specified entity to the target value object. This method is similar to * ${valueObjectRef.transformationMethodName}(), but it does not handle any attributes in the target * value object that are "read-only" (as those do not have setter methods exposed). */ public void ${valueObjectRef.transformationMethodName}( $entity.fullyQualifiedEntityName sourceEntity, $valueObjectRef.targetElement.fullyQualifiedName targetVO); /** * Converts this DAO's entity to an object of type {@link $valueObjectRef.targetElement.fullyQualifiedName}. */ public $valueObjectRef.targetElement.fullyQualifiedName ${valueObjectRef.transformationMethodName}($entity.fullyQualifiedEntityName entity); /** * Converts this DAO's entity to a Collection of instances of type {@link $valueObjectRef.targetElement.fullyQualifiedName}. */ public void ${valueObjectRef.transformationToCollectionMethodName}(java.util.Collection entities); /** * Copies the fields of {@link $valueObjectRef.targetElement.fullyQualifiedName} to the specified entity. * @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE, * it will be copied regardless of its value. */ public void ${valueObjectRef.transformationToEntityMethodName}( $valueObjectRef.targetElement.fullyQualifiedName sourceVO, $entity.fullyQualifiedEntityName targetEntity, boolean copyIfNull); /** * Converts an instance of type {@link $valueObjectRef.targetElement.fullyQualifiedName} to this DAO's entity. */ public $entity.fullyQualifiedEntityName ${valueObjectRef.transformationToEntityMethodName}($valueObjectRef.targetElement.fullyQualifiedName $stringUtils.uncapitalize($valueObjectRef.name)); /** * Converts a Collection of instances of type {@link $valueObjectRef.targetElement.fullyQualifiedName} to this * DAO's entity. */ public void ${valueObjectRef.transformationToEntityCollectionMethodName}(java.util.Collection instances); #end #set ($identifier = $entity.identifiers.iterator().next()) #set ($argumentName = $stringUtils.uncapitalize($entity.name)) /** * Loads an instance of $entity.fullyQualifiedEntityName from the persistent store. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public $rootEntityType load($identifier.type.fullyQualifiedName $identifier.name) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * <p> * Does the same thing as {@link #load($identifier.type.fullyQualifiedName)} with an * additional flag called <code>transform</code>. If this flag is set to <code>$entity.daoNoTransformationConstantName</code> then * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can * optionally transform the entity (into a value object for example). By default, transformation does * not occur. * </p> * * @param $identifier.name the identifier of the entity to load. * @return either the entity or the object transformed from the entity. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public Object load(int transform, $identifier.type.fullyQualifiedName $identifier.name) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * Loads all entities of type {@link ${entity.fullyQualifiedEntityName}}. * * @return the loaded entities. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public $entityCollectionType loadAll() throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * <p> * Does the same thing as {@link #loadAll()} with an * additional flag called <code>transform</code>. If this flag is set to <code>$entity.daoNoTransformationConstantName</code> then * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally * transform the entity (into a value object for example). By default, transformation does * not occur. * </p> * * @param transform the flag indicating what transformation to use. * @return the loaded entities. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public java.util.Collection loadAll(final int transform) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; ## Only add these methods if the entity isn't abstract #if (!$entity.abstract) /** * Creates an instance of $entity.fullyQualifiedEntityName and adds it to the persistent store. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public $rootEntityType create($entity.fullyQualifiedEntityName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * <p> * Does the same thing as {@link #create($entity.fullyQualifiedEntityName)} with an * additional flag called <code>transform</code>. If this flag is set to <code>$entity.daoNoTransformationConstantName</code> then * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally * transform the entity (into a value object for example). By default, transformation does * not occur. * </p> * * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public Object create(int transform, $entity.fullyQualifiedEntityName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * Creates a new instance of $entity.fullyQualifiedEntityName and adds * from the passed in <code>entities</code> collection * * @param entities the collection of $entity.fullyQualifiedEntityName * instances to create. * * @return the created instances. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public $entityCollectionType create($entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * <p> * Does the same thing as {@link #create($entity.fullyQualifiedEntityName)} with an * additional flag called <code>transform</code>. If this flag is set to <code>$entity.daoNoTransformationConstantName</code> then * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally * transform the entities (into value objects for example). By default, transformation does * not occur. * </p> * * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public java.util.Collection create(int transform, $entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##if ($enableDaoPropertiesCreateMethod.equalsIgnoreCase('true')) #* *##set ($attributes = $entity.getAttributes(true, $entity.usingAssignedIdentifier)) #* *##if (!$attributes.empty) /** * <p> * Creates a new <code>$entity.fullyQualifiedEntityName</code> * instance from <strong>all</strong> attributes and adds it to * the persistent store. * </p> */ public $rootEntityType create( #* *##foreach($attribute in $attributes) $attribute.type.fullyQualifiedName $attribute.name#if($velocityCount != $attributes.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName};#end #* *##end /** * <p> * Does the same thing as {@link #create($entity.getAttributeTypeList(true,false))} with an * additional flag called <code>transform</code>. If this flag is set to <code>$entity.daoNoTransformationConstantName</code> then * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally * transform the entity (into a value object for example). By default, transformation does * not occur. * </p> * * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public Object create( int transform, #* *##foreach($attribute in $attributes) $attribute.type.fullyQualifiedName $attribute.name#if($velocityCount != $attributes.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName};#end #* *##end #* *##end #* *##set ($requiredProperties = $entity.getRequiredProperties(true,false)) #* *##if (!$requiredProperties.empty && $entity.getRequiredAttributes(true,false).size() != $requiredProperties.size()) /** * <p> * Creates a new <code>$entity.fullyQualifiedEntityName</code> * instance from only <strong>required</strong> properties (attributes * and association ends) and adds it to the persistent store. * </p> * * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public $rootEntityType create( #* *##foreach($property in $requiredProperties) $property.getterSetterTypeName $property.name#if($velocityCount != $requiredProperties.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName};#end #* *##end /** * <p> * Does the same thing as {@link #create($entity.getRequiredAttributeTypeList(true,false))} with an * additional flag called <code>transform</code>. If this flag is set to <code>$entity.daoNoTransformationConstantName</code> then * the returned entity will <strong>NOT</strong be transformed. If this flag is any of the other constants * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally * transform the entity (into a value object for example). By default, transformation does * not occur. * </p> * * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public Object create( int transform, #* *##foreach($property in $requiredProperties) $property.getterSetterTypeName $property.name#if($velocityCount != $requiredProperties.size()),#else) throws ${entity.fullyQualifiedDaoDefaultExceptionName};#end #* *##end #* *##end #**##end #end /** * Updates the <code>$argumentName</code> instance in the persistent store. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public void update($entity.fullyQualifiedEntityName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * Updates all instances in the <code>entities</code> collection in the persistent store. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public void update($entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * Removes the instance of $entity.fullyQualifiedEntityName from the persistent store. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public void remove($entity.fullyQualifiedEntityName $argumentName) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * Removes the instance of $entity.fullyQualifiedEntityName having the given * <code>identifier</code> from the persistent store. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public void remove($identifier.type.fullyQualifiedName $identifier.name) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; /** * Removes all entities in the given <code>entities<code> collection. * @throws ${entity.fullyQualifiedDaoDefaultExceptionName} */ public void remove($entityCollectionType entities) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; #foreach ($operation in $entity.queryOperations) #**##set ($returnType = $operation.returnType.fullyQualifiedName) /** $operation.getDocumentation(" * ") */ #**##if ($operation.exceptionsPresent) $operation.visibility $returnType $operation.signature throws $operation.exceptionList, ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##else $operation.visibility $returnType $operation.signature throws ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##end /** * <p> * Does the same thing as {@link #${operation.getSignature(false)}} with an * additional argument called <code>queryString</code>. This <code>queryString</code> * argument allows you to override the query string defined in {@link #${operation.getSignature(false)}}. * </p> */ #**##if ($operation.exceptionsPresent) $operation.visibility $returnType ${operation.name}(String queryString#if(!$operation.arguments.empty), ${operation.typedArgumentList}#end) throws $operation.exceptionList, ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##else $operation.visibility $returnType ${operation.name}(String queryString#if(!$operation.arguments.empty), ${operation.typedArgumentList}#end) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##end #**##if ($operation.query && !$operation.returnType.collectionType) #set ($returnType = "Object") #**##end /** * <p> * Does the same thing as {@link #${operation.getSignature(false)}} with an * additional flag called <code>transform</code>. If this flag is set to <code>$entity.daoNoTransformationConstantName</code> then * finder results will <strong>NOT</strong> be transformed during retrieval. * If this flag is any of the other constants defined here * then finder results <strong>WILL BE</strong> passed through an operation which can optionally * transform the entities (into value objects for example). By default, transformation does * not occur. * </p> */ #**##if ($operation.exceptionsPresent) $operation.visibility $returnType ${operation.name}(int transform#if(!$operation.arguments.empty), ${operation.typedArgumentList}#end) throws $operation.exceptionList, ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##else $operation.visibility $returnType ${operation.name}(int transform#if(!$operation.arguments.empty), ${operation.typedArgumentList}#end) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##end /** * <p> * Does the same thing as {@link #${operation.name}(boolean#if(!$operation.arguments.empty), ${operation.argumentTypeNames}#end)} with an * additional argument called <code>queryString</code>. This <code>queryString</code> * argument allows you to override the query string defined in {@link #${operation.name}(int#if(!$operation.arguments.empty), ${operation.typedArgumentList}#end)}. * </p> */ #**##if ($operation.exceptionsPresent) $operation.visibility $returnType ${operation.name}(int transform, String queryString#if(!$operation.arguments.empty), ${operation.typedArgumentList}#end) throws $operation.exceptionList, ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##else $operation.visibility $returnType ${operation.name}(int transform, String queryString#if(!$operation.arguments.empty), ${operation.typedArgumentList}#end) throws ${entity.fullyQualifiedDaoDefaultExceptionName}; #**##end #end #foreach ($operation in $entity.daoBusinessOperations) #**##set ($returnType = $operation.returnType.fullyQualifiedName) /** $operation.getDocumentation(" * ") */ #**##if ($operation.exceptionsPresent) $operation.visibility $returnType $operation.signature throws $operation.exceptionList; #**##else $operation.visibility $returnType $operation.signature; #**##end #end } 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/DaoDefaultException.vsl Index: DaoDefaultException.vsl =================================================================== // license-header java merge-point // // Attention: Generated code! Do not modify by hand!! // Generated by: DaoDefaultException.vsl in andromda-java-cartridge. // #set ($generatedFile = "${stringUtils.replace($entity.fullyQualifiedDaoDefaultExceptionName,'.','/')}.java") #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end import org.apache.commons.beanutils.PropertyUtils; /** $entity.getDocumentation(" * ") */ public class ${entity.daoDefaultExceptionName} extends java.lang.Exception { /** * The default constructor. */ public ${entity.daoDefaultExceptionName}() {} /** * Constructs a new instance of ${entity.daoDefaultExceptionName} * * @param throwable the parent Throwable */ public ${entity.daoDefaultExceptionName}(Throwable throwable) { super(f... [truncated message content] |