From: Vance K. <va...@us...> - 2006-01-03 01:03:21
|
User: vancek Date: 06/01/02 17:03:14 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: moved getAttributesAsList from utils to session metafacade Revision Changes Path 1.2 +4 -4 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- Entity.vsl 28 Dec 2005 00:32:55 -0000 1.1 +++ Entity.vsl 3 Jan 2006 01:03:14 -0000 1.2 @@ -86,10 +86,10 @@ * @param $attribute.name Value for the ${attribute.name} property #end */ - public ${entity.entityName}($transform.getAttributesAsList($allAttributes, true, true)) + public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)) { #if(!$inheritedAttributes.empty) - super($transform.getAttributesAsList($inheritedAttributes, false, true)); + super($entity.getAttributesAsList($inheritedAttributes, false, true)); #end #foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) ${attribute.setterName}(${attribute.name}); @@ -108,10 +108,10 @@ * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation role #* *##end */ - public ${entity.entityName}($transform.getAttributesAsList($allAttributes, true, true)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)#if ($relation.one2Many || $relation.many2Many)${relation.relationType}<${relation.otherEnd.type.name}> $relation.otherEnd.name#else${relation.relationType} $relation.otherEnd.name#end#if($velocityCount != $relations.size()), #end#end) + public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)#if ($relation.one2Many || $relation.many2Many)${relation.relationType}<${relation.otherEnd.type.name}> $relation.otherEnd.name#else${relation.relationType} $relation.otherEnd.name#end#if($velocityCount != $relations.size()), #end#end) { // Call suitable class constructor - this($transform.getAttributesAsList($allAttributes, false, true)); + this($entity.getAttributesAsList($allAttributes, false, true)); // Set the CMR relations #* *##foreach ($relation in $relations) |
From: Vance K. <va...@us...> - 2006-01-06 13:46:16
|
User: vancek Date: 06/01/06 05:46:07 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: fixed comments and removed transaction annotation from entity bean Revision Changes Path 1.3 +55 -54 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- Entity.vsl 3 Jan 2006 01:03:14 -0000 1.2 +++ Entity.vsl 6 Jan 2006 13:46:06 -0000 1.3 @@ -44,28 +44,40 @@ { private static final long serialVersionUID = ${entity.serialVersionUID}L; +#set ($constants = $entity.getConstants(true)) +#if (!$constants.empty) - // ----------- constant definitions ------------- -#foreach($constant in $entity.getConstants(true)) + // ----------- Constant Definitions ------------- + +#**##foreach($constant in $constants) @javax.persistence.Transient private static final $constant.type.fullyQualifiedName $constant.name = $constant.defaultValue; +#**##end #end +#set ($attributes = $entity.attributes) +#if (!$attributes.empty) - // ----------- attribute definitions ------------ -#foreach ( $attribute in $entity.attributes) + // ----------- Attribute Definitions ------------ + +#**##foreach ($attribute in $attributes) private $attribute.type.fullyQualifiedName $attribute.name; +#**##end #end +#set ($entityRelations = $entity.allEntityRelations) +#if (!$entityRelations.empty) - // --------- relationship definitions ----------- -#foreach ($associationEnd in $entity.allEntityRelations) -#**##if ($associationEnd.one2Many || $associationEnd.many2Many) + // --------- Relationship Definitions ----------- + +#**##foreach ($associationEnd in $entityRelations) +#**##**##if ($associationEnd.one2Many || $associationEnd.many2Many) private $associationEnd.relationType<${associationEnd.otherEnd.type.name}> ${associationEnd.otherEnd.name}; -#**##else +#**##**##else private $associationEnd.relationType ${associationEnd.otherEnd.name}; +#**##**##end #**##end #end - // --------------- constructors ----------------- + // --------------- Constructors ----------------- public ${entity.entityName}() { @@ -138,7 +150,7 @@ } #end - // --------- accessors for constants ---------- + // --------- Constant Accessors ---------- #foreach($constant in $entity.getConstants(true)) /** * Get the <code>$constant.name</code> constant @@ -149,9 +161,11 @@ return $constant.name; } #end +#if (!$attributes.empty) + + // -------- Attribute Accessors ---------- - // -------- attribute getters/setters ---------- -#foreach ($attribute in $entity.attributes) +#**##foreach ($attribute in $entity.attributes) #**##set ($visibility = $attribute.visibility) /** * Get the $attribute.name property. @@ -174,9 +188,6 @@ ## LOB type is specified - also sepcify FetchType if set to EAGER since default fetch type for LOB annotation is LAZY @javax.persistence.Lob(type = javax.persistence.LobType.${attribute.lobType}#if ($attribute.eager), fetch = javax.persistence.FetchType.EAGER#end) #**##end -#**##if ($attribute.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${attribute.transactionType}) -#**##end @javax.persistence.Column(name = "${attribute.columnName}"#if ($attribute.unique), unique = ${attribute.unique}#end#if (!$attribute.columnNullable), nullable = ${attribute.columnNullable}#end#if ($attribute.columnLength), length = ${attribute.columnLength}#end#if ($attribute.columnDefinition), columnDefinition = "${attribute.columnDefinition}"#end#if ($attribute.columnPrecision), precision = ${attribute.columnPrecision}#end#if ($attribute.columnScale), scale = ${attribute.columnScale}#end) ## Only add the fetch type property for LAZY hints - default is EAGER #**##if ($attribute.lazy) @@ -199,9 +210,10 @@ } #**##end +#**##end #end - // ------------- relations ------------------ + // ------------- Relations ------------------ #foreach ($associationEnd in $entity.allEntityRelations) #**##set ($target = $associationEnd.otherEnd) @@ -219,9 +231,6 @@ #* *##set ($argExists = false) @javax.persistence.ManyToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end public $associationEnd.relationType ${target.getterName}() { return this.${target.name}; @@ -251,9 +260,6 @@ */ #* *##set ($argExists = false) @javax.persistence.OneToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($associationEnd.navigable)#if ($argExists) ,#end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end #* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) #* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) @javax.persistence.OrderBy("${target.orderByClause}") @@ -289,9 +295,6 @@ #* *##if($associationEnd.owning) @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) #* *##end -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end public $associationEnd.relationType ${target.getterName}() { return this.${target.name}; @@ -323,9 +326,6 @@ #* *##if(($associationEnd.owning) && ${associationEnd.association.tableName}) @javax.persistence.JoinTable(table = @javax.persistence.Table(name = "${associationEnd.association.tableName}")) #* *##end -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end #* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) #* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) @javax.persistence.OrderBy("${target.orderByClause}") @@ -350,7 +350,7 @@ #**##end #end - // ----------------- finder method ------------------ + // ----------------- Finder Method ------------------ #foreach ($finder in $entity.getQueryOperations(true)) #**##set ($returnType = $finder.returnType.fullyQualifiedName) @@ -397,17 +397,17 @@ } #end## finder operations - // --------------- business methods ----------------- +#set ($businessOperations = $entity.businessOperations) +#if (!$businessOperations.empty) + + // --------------- Business Methods ----------------- -#foreach ($operation in $entity.businessOperations) +#**##foreach ($operation in ) #**##set ($signature = $operation.signature) #**##set ($visibility = $operation.visibility.toString()) /** $operation.getDocumentation(" * ") */ -#**##if ($operation.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${operation.transactionType}) -#**##end #**##set ($returnType = $operation.returnType.fullyQualifiedName) #**##if ($operation.exceptionsPresent) $visibility abstract $returnType $signature @@ -415,5 +415,6 @@ #**##else $visibility abstract $returnType $signature; #**##end +#**##end #end } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-17 04:13:01
|
User: vancek Date: 06/01/16 20:12:54 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: IMPORTANT: now used as the entity implementation class - refer to EntityEmbeddable.vsl for base entity class Revision Changes Path 1.4 +40 -354 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- Entity.vsl 6 Jan 2006 13:46:06 -0000 1.3 +++ Entity.vsl 17 Jan 2006 04:12:54 -0000 1.4 @@ -1,137 +1,60 @@ // license-header java merge-point -/* Autogenerated by AndroMDA (Entity.vsl) - do not edit */ +/* Autogenerated by AndroMDA (EntityImpl.vsl)*/ #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end +#set ($generatedFile = "${stringUtils.replace($entity.fullyQualifiedEntityName,'.','/')}.java") #set ($identifier = $entity.identifiers.iterator().next()) /** - * Autogenerated POJO EJB3 super class for ${entity.entityName} containing the - * bulk of the entity implementation. + * Autogenerated POJO EJB3 implementation class for ${entity.entityName}. * - * This is an abstract super class and autogenerated by AndroMDA using the EJB3 - * cartridge. - * - * DO NOT MODIFY this class. + * Add any manual implementation within this class. This class will NOT + * be overwritten with incremental changes. * $entity.getDocumentation(" * ") * */ -#if ($entity.embeddableSuperclass) -...@ja...rsistence.EmbeddableSuperclass#if ($entity.accessType)(access = javax.persistence.AccessType.${entity.accessType})#end -#else @javax.persistence.Entity#if ($entity.accessType)(access = javax.persistence.AccessType.${entity.accessType})#end -...@ja...rsistence.EntityListener(${entity.fullyQualifiedEntityListenerName}.class) -...@ja...rsistence.Table(name = "${entity.tableName}") -#**##if ($entity.requiresSpecializationMapping) -...@ja...heritance(strategy = javax.persistence.InheritanceType.${entity.inheritanceStrategy}, discriminatorType = javax.persistence.DiscriminatorType.${entity.discriminatorType}#if ($entity.discriminatorValue), discriminatorValue = "${entity.discriminatorValue}"#end) -#* *##if ($entity.inheritanceSingleTable || $entity.inheritanceJoined) -...@ja...rsistence.DiscriminatorColumn(name = "${entity.discriminatorColumn}"#if ($entity.discriminatorColumnDefinition), columnDefinition = "${entity.discriminatorColumnDefinition}"#end#if ($entity.discriminatorLength > 0), length = ${entity.discriminatorLength}#end) -#* *##end -#**##elseif ($entity.requiresGeneralizationMapping) -...@ja...heritance#if ($entity.discriminatorValue)(discriminatorValue = "${entity.discriminatorValue}")#end - -#**##end -#end -public abstract class ${entity.entityName} -#if($entity.generalization) - extends ${entity.generalization.fullyQualifiedName} -#end +public#if ($entity.abstract) abstract#end class ${entity.entityName} + extends ${entity.fullyQualifiedEntityEmbeddableName} implements java.io.Serializable { + /** + * The serial version UID of this class required for serialization. + */ private static final long serialVersionUID = ${entity.serialVersionUID}L; -#set ($constants = $entity.getConstants(true)) -#if (!$constants.empty) - - // ----------- Constant Definitions ------------- - -#**##foreach($constant in $constants) - @javax.persistence.Transient - private static final $constant.type.fullyQualifiedName $constant.name = $constant.defaultValue; -#**##end -#end -#set ($attributes = $entity.attributes) -#if (!$attributes.empty) - - // ----------- Attribute Definitions ------------ - -#**##foreach ($attribute in $attributes) - private $attribute.type.fullyQualifiedName $attribute.name; -#**##end -#end -#set ($entityRelations = $entity.allEntityRelations) -#if (!$entityRelations.empty) - - // --------- Relationship Definitions ----------- - -#**##foreach ($associationEnd in $entityRelations) -#**##**##if ($associationEnd.one2Many || $associationEnd.many2Many) - private $associationEnd.relationType<${associationEnd.otherEnd.type.name}> ${associationEnd.otherEnd.name}; -#**##**##else - private $associationEnd.relationType ${associationEnd.otherEnd.name}; -#**##**##end -#**##end -#end - // --------------- Constructors ----------------- + // --------------- constructors ----------------- + /** + * Default ${entity.name} constructor + */ public ${entity.entityName}() { - // default null constructor + super(); } ## Autogenerate a constructor implementation with all attributes. -#set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) -#set ($inheritedAttributes = $transform.filterByVisibility($entity.inheritedInstanceAttributes, "public")) #set ($instanceAttributes = $transform.filterByVisibility($entity.instanceAttributes, "public")) - +#set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) /** * Implementation for the main constructor with all POJO attributes. - * This method sets all POJO fields defined in this class to the + * This method sets all POJO fields defined in this/super class to the * values provided by the parameters. * -#foreach($attribute in $transform.filterUpdatableAttributes($allAttributes)) +#foreach($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) * @param $attribute.name Value for the ${attribute.name} property #end */ public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)) { -#if(!$inheritedAttributes.empty) - super($entity.getAttributesAsList($inheritedAttributes, false, true)); -#end -#foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) - ${attribute.setterName}(${attribute.name}); -#end - } - -#set ($relations = $entity.allEntityRelations) -#if (!$relations.empty) -#**##if ($entity.syntheticCreateMethodAllowed) - /** - * Constructor with all POJO attribute values and CMR relations. -#* *##foreach($attribute in $allAttributes) - * @param $attribute.name Value for the $attribute.name property -#* *##end -#* *##foreach ($relation in $relations) - * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation role -#* *##end - */ - public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)#if ($relation.one2Many || $relation.many2Many)${relation.relationType}<${relation.otherEnd.type.name}> $relation.otherEnd.name#else${relation.relationType} $relation.otherEnd.name#end#if($velocityCount != $relations.size()), #end#end) - { - // Call suitable class constructor - this($entity.getAttributesAsList($allAttributes, false, true)); - - // Set the CMR relations -#* *##foreach ($relation in $relations) - ${relation.otherEnd.setterName}($relation.otherEnd.name); -#* *##end + super($entity.getAttributesAsList($allAttributes, false, true)); } -#**##end -#end #foreach ($operation in $entity.getCreateMethods(true)) #**##set ($opArguments = $transform.getArgumentsAsList(${operation.argumentNames})) @@ -144,276 +67,39 @@ */ public ${entity.entityName}(${operation.typedArgumentList}) { -#**##foreach($attribute in $opArguments) - this.${attribute} = $attribute; -#**##end - } -#end - - // --------- Constant Accessors ---------- -#foreach($constant in $entity.getConstants(true)) - /** - * Get the <code>$constant.name</code> constant -$constant.getDocumentation(" * ") - * - $constant.visibility $constant.type.fullyQualifiedName ${constant.getterName}() - { - return $constant.name; - } -#end -#if (!$attributes.empty) - - // -------- Attribute Accessors ---------- - -#**##foreach ($attribute in $entity.attributes) -#* *##set ($visibility = $attribute.visibility) - /** - * Get the $attribute.name property. -$attribute.getDocumentation(" * ") - * @return $attribute.type.fullyQualifiedName The value of ${attribute.name} - */ -#* *##if ($attribute.identifier) -#* *##if ($attribute.sequenceGeneratorType || $attribute.tableGeneratorType) - @javax.persistence.TableGenerator(name = "${attribute.generatorName}"#if ($attribute.sequenceGeneratorType), sequenceName = "${attribute.generatorSourceName}"#elseif ($attribute.tableGeneratorType), tableName = "${attribute.generatorSourceName}"#end,#if ($attribute.tableGeneratorType) pkColumnValue = "${attribute.generatorPkColumnValue}",#end#if ($attribute.sequenceGeneratorType) initialValue = ${attribute.generatorInitialValue},#end allocationSize = ${attribute.generatorAllocationSize}) -#* *##end - @javax.persistence.Id(generate = javax.persistence.GeneratorType.${attribute.generatorType}#if ($attribute.sequenceGeneratorType || $attribute.tableGeneratorType), generator = "${attribute.generatorName}"#end) -#* *##end -#* *##if ($attribute.version) - @javax.persistence.Version -#* *##end -#* *##if ($attribute.transient) - @javax.persistence.Transient -#* *##end -#* *##if ($attribute.lobType) -## LOB type is specified - also sepcify FetchType if set to EAGER since default fetch type for LOB annotation is LAZY - @javax.persistence.Lob(type = javax.persistence.LobType.${attribute.lobType}#if ($attribute.eager), fetch = javax.persistence.FetchType.EAGER#end) -#* *##end - @javax.persistence.Column(name = "${attribute.columnName}"#if ($attribute.unique), unique = ${attribute.unique}#end#if (!$attribute.columnNullable), nullable = ${attribute.columnNullable}#end#if ($attribute.columnLength), length = ${attribute.columnLength}#end#if ($attribute.columnDefinition), columnDefinition = "${attribute.columnDefinition}"#end#if ($attribute.columnPrecision), precision = ${attribute.columnPrecision}#end#if ($attribute.columnScale), scale = ${attribute.columnScale}#end) -## Only add the fetch type property for LAZY hints - default is EAGER -#* *##if ($attribute.lazy) - @javax.persistence.Basic(fetch = javax.persistence.FetchType.LAZY) -#* *##end - public $attribute.type.fullyQualifiedName ${attribute.getterName}() - { - return $attribute.name; - } - -## Allow only if not a version attribute since they are set by the container - No setter method is made available -#* *##if (!$attribute.version) - /** - * Set the $attribute.name property. - * @param value the new value - */ - public void ${attribute.setterName}($attribute.type.fullyQualifiedName value) - { - this.${attribute.name} = value; - } -#* *##end - -#**##end -#end - - // ------------- Relations ------------------ - -#foreach ($associationEnd in $entity.allEntityRelations) -#**##set ($target = $associationEnd.otherEnd) -#**##if($target.navigable) -#* *##if ($associationEnd.many2One) -## -## MANY TO ONE RELATIONSHIP -## -## Default fetch type: EAGER -## - /** - * Get the ${target.name} - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.ManyToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) - @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) - public $associationEnd.relationType ${target.getterName}() - { - return this.${target.name}; - } - -#* *##if(!$target.readOnly) - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName}($associationEnd.relationType ${target.name}) - { - this.${target.name} = ${target.name}; - } -#* *##end -#* *##elseif ($associationEnd.one2Many) -## -## ONE TO MANY RELATIONSHIP -## -## Include the mappedBy element for bidirection relationships ONLY -## Default fetch type: LAZY -## If orderBy element is not specified, container assumes PK ordering -## - /** - * Get the ${target.name} Collection - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.OneToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($associationEnd.navigable)#if ($argExists) ,#end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) -#* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) -#* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) - @javax.persistence.OrderBy("${target.orderByClause}") -#* *##else - @javax.persistence.OrderBy -#* *##end -#* *##end - public $associationEnd.relationType<${target.type.name}> ${target.getterName}() - { - return this.${target.name}; - } - - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName} (${associationEnd.relationType}<${target.type.name}> ${target.name}) - { - this.${target.name} = ${target.name}; - } -#* *##elseif ($associationEnd.one2One) -## -## ONE TO ONE RELATIONSHIP -## -## Default fetch type: EAGER -## - /** - * Get the ${target.name} - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.OneToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if(!$associationEnd.owning)#if ($argExists), #end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) -#* *##if($associationEnd.owning) - @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) -#* *##end - public $associationEnd.relationType ${target.getterName}() - { - return this.${target.name}; - } - -#* *##if(!$target.readOnly) - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName}($associationEnd.relationType ${target.name}) - { - this.${target.name} = ${target.name}; - } -#* *##end -#* *##elseif ($associationEnd.many2Many) -## -## MANY TO MANY RELATIONSHIP -## -## Default fetch type: LAZY -## - /** - * Get the ${target.name} Collection - * @return $associationEnd.relationType - */ -#* *##set ($argExists = false) - @javax.persistence.ManyToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) -## Use Aggregation and Composition to determine owning side -#* *##if(($associationEnd.owning) && ${associationEnd.association.tableName}) - @javax.persistence.JoinTable(table = @javax.persistence.Table(name = "${associationEnd.association.tableName}")) -#* *##end -#* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) -#* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) - @javax.persistence.OrderBy("${target.orderByClause}") -#* *##else - @javax.persistence.OrderBy -#* *##end -#* *##end - public $associationEnd.relationType<${target.type.name}> ${target.getterName}() - { - return this.${target.name}; - } - - /** - * Set the ${target.name} - * @param ${target.name} - */ - public void ${target.setterName} (${associationEnd.relationType}<${target.type.name}> ${target.name}) - { - this.${target.name} = ${target.name}; + super(${operation.argumentNames}); } -#* *##end -#**##end #end - - // ----------------- Finder Method ------------------ - -#foreach ($finder in $entity.getQueryOperations(true)) -#**##set ($returnType = $finder.returnType.fullyQualifiedName) -#**##set ($parameterList = $finder.typedArgumentList) -#**##if ($finder.arguments.empty) -#* *##set ($parameters = "javax.persistence.EntityManager em") -#**##else -#* *##set ($parameters = "javax.persistence.EntityManager em, ${parameterList}") -#**##end - /** -$finder.getDocumentation(" * ") - * - * Finder method for ${entity.name} entity using a query. - * @param em javax.persistence.EntityManager -#**##foreach ($parameter in $finder.arguments) - * @param $parameter.type.fullyQualifiedName ${parameter.name} -#**##end - * @return $returnType - */ - $finder.visibility static $returnType#if ($returnType == "java.util.Collection" || $returnType == "java.util.List")<${entity.name}>#end ${finder.name}($parameters) - { - javax.persistence.Query query = em.createQuery("$finder.query"); -#**##foreach ($parameter in $finder.arguments) -#* *##set ($index = $velocityCount - 1) -#* *##if ($parameter.firstResult) - query.setFirstResult(${parameter.name}); -#* *##elseif ($parameter.maxResults) - query.setMaxResults(${parameter.name}); -#* *##else -#* *##if ($finder.useNamedParameters) - query.setParameter("${parameter.name}",#if ($parameter.type.primitive) new ${parameter.type.wrapperName}(${parameter.name})#else ${parameter.name}#end#if ($parameter.temporalType), javax.persistence.TemporalType.${parameter.temporalType}#end); -#* *##else - query.setParameter(${index},#if ($parameter.type.primitive) new ${parameter.type.wrapperName}(${parameter.name})#else ${parameter.name}#end#if ($parameter.temporalType), javax.persistence.TemporalType.${parameter.temporalType}#end); -#* *##end -#* *##end -#**##end -#**##if ($finder.returnType.primitive) - return (($finder.returnType.wrapperName)query.getSingleResult()).${returnType}Value(); -#**##elseif (!$finder.returnType.collectionType) - return ($returnType)query.getSingleResult(); -#**##else - return query.getResultList(); -#**##end - } - -#end## finder operations -#set ($businessOperations = $entity.businessOperations) -#if (!$businessOperations.empty) +#set ($operations = $entity.businessOperations) +#if (!$operations.empty) // --------------- Business Methods ----------------- -#**##foreach ($operation in ) +#**##foreach ($operation in $operations) #* *##set ($signature = $operation.signature) +#* *##set ($interfaceType = "interface") #* *##set ($visibility = $operation.visibility.toString()) /** $operation.getDocumentation(" * ") */ #* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##if ($operation.exceptionsPresent) - $visibility abstract $returnType $signature - throws $operation.exceptionList; + $visibility $returnType $signature + throws $operation.exceptionList + { + // TODO put your implementation here. +#* *##if ($operation.returnTypePresent) + return $operation.returnType.javaNullString; +#* *##end + } #* *##else - $visibility abstract $returnType $signature; + $visibility $returnType $signature + { + // TODO put your implementation here. +#* *##if ($operation.returnTypePresent) + return $operation.returnType.javaNullString; +#* *##end + } #* *##end #**##end #end |
From: Vance K. <va...@us...> - 2006-01-18 08:45:41
|
User: vancek Date: 06/01/18 00:45:33 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: getAttributesAsList method contains extra args to determine if to include identifiers if composite primary key exsits Revision Changes Path 1.5 +2 -2 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- Entity.vsl 17 Jan 2006 04:12:54 -0000 1.4 +++ Entity.vsl 18 Jan 2006 08:45:33 -0000 1.5 @@ -51,9 +51,9 @@ * @param $attribute.name Value for the ${attribute.name} property #end */ - public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true)) + public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true, false)) { - super($entity.getAttributesAsList($allAttributes, false, true)); + super($entity.getAttributesAsList($allAttributes, false, true, false)); } #foreach ($operation in $entity.getCreateMethods(true)) |
From: Vance K. <va...@us...> - 2006-01-23 05:43:51
|
User: vancek Date: 06/01/22 21:43:43 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: won't generate auto constructor if syntheticCreateMethodAllowed is false Revision Changes Path 1.6 +6 -3 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- Entity.vsl 18 Jan 2006 08:45:33 -0000 1.5 +++ Entity.vsl 23 Jan 2006 05:43:43 -0000 1.6 @@ -42,19 +42,21 @@ ## Autogenerate a constructor implementation with all attributes. #set ($instanceAttributes = $transform.filterByVisibility($entity.instanceAttributes, "public")) #set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) +#if ($entity.syntheticCreateMethodAllowed) /** * Implementation for the main constructor with all POJO attributes. * This method sets all POJO fields defined in this/super class to the * values provided by the parameters. * -#foreach($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) +#**##foreach($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) * @param $attribute.name Value for the ${attribute.name} property -#end +#**##end */ public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true, false)) { super($entity.getAttributesAsList($allAttributes, false, true, false)); } +#end #foreach ($operation in $entity.getCreateMethods(true)) #**##set ($opArguments = $transform.getArgumentsAsList(${operation.argumentNames})) @@ -69,6 +71,7 @@ { super(${operation.argumentNames}); } + #end #set ($operations = $entity.businessOperations) #if (!$operations.empty) |
From: Vance K. <va...@us...> - 2006-01-25 02:46:42
|
User: vancek Date: 06/01/24 18:46:36 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: used allInstanceAttributes for constructor Revision Changes Path 1.7 +2 -3 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- Entity.vsl 23 Jan 2006 05:43:43 -0000 1.6 +++ Entity.vsl 25 Jan 2006 02:46:35 -0000 1.7 @@ -40,15 +40,14 @@ } ## Autogenerate a constructor implementation with all attributes. -#set ($instanceAttributes = $transform.filterByVisibility($entity.instanceAttributes, "public")) #set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) #if ($entity.syntheticCreateMethodAllowed) /** - * Implementation for the main constructor with all POJO attributes. + * Implementation for the constructor with all POJO attributes. * This method sets all POJO fields defined in this/super class to the * values provided by the parameters. * -#**##foreach($attribute in $transform.filterUpdatableAttributes($instanceAttributes)) +#**##foreach($attribute in $transform.filterUpdatableAttributes($allAttributes)) * @param $attribute.name Value for the ${attribute.name} property #**##end */ |
From: Vance K. <va...@us...> - 2006-01-26 04:36:48
|
User: vancek Date: 06/01/25 20:36:42 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: added Table and EntityListener annotations Revision Changes Path 1.8 +2 -0 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -r1.7 -r1.8 --- Entity.vsl 25 Jan 2006 02:46:35 -0000 1.7 +++ Entity.vsl 26 Jan 2006 04:36:42 -0000 1.8 @@ -19,6 +19,8 @@ @javax.persistence.Entity#if ($entity.accessType)(access = javax.persistence.AccessType.${entity.accessType})#end +...@ja...rsistence.Table(name = "${entity.tableName}") +...@ja...rsistence.EntityListener(${entity.fullyQualifiedEntityListenerName}.class) public#if ($entity.abstract) abstract#end class ${entity.entityName} extends ${entity.fullyQualifiedEntityEmbeddableName} implements java.io.Serializable |
From: Vance K. <va...@us...> - 2006-01-26 06:53:21
|
User: vancek Date: 06/01/25 22:53:15 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: added constructor setting all attributes and relations Revision Changes Path 1.9 +20 -0 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -r1.8 -r1.9 --- Entity.vsl 26 Jan 2006 04:36:42 -0000 1.8 +++ Entity.vsl 26 Jan 2006 06:53:14 -0000 1.9 @@ -57,8 +57,28 @@ { super($entity.getAttributesAsList($allAttributes, false, true, false)); } + #end +#set ($relations = $entity.allEntityRelations) +#if (!$relations.empty) +#**##if ($entity.syntheticCreateMethodAllowed) + /** + * Constructor with all POJO attribute values and CMR relations. + * +#* *##foreach($attribute in $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) + * @param $attribute.name Value for the ${attribute.name} property +#* *##end +#* *##foreach ($relation in $relations) + * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation role +#* *##end + */ + public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true, false)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)${relation.otherEnd.getterSetterTypeName} $relation.otherEnd.name#if($velocityCount != $relations.size()), #end#end) + { + super($entity.getAttributesAsList($allAttributes, false, true, false)#if(!$allAttributes.empty), #end#foreach ($relation in $relations)$relation.otherEnd.name#if($velocityCount != $relations.size()), #end#end); + } +#**##end +#end #foreach ($operation in $entity.getCreateMethods(true)) #**##set ($opArguments = $transform.getArgumentsAsList(${operation.argumentNames})) /** |
From: Vance K. <va...@us...> - 2006-01-31 15:16:09
|
User: vancek Date: 06/01/31 07:16:00 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: entity methods throw UnsupportedOperationException when method is not implemented Revision Changes Path 1.12 +4 -3 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -r1.11 -r1.12 --- Entity.vsl 29 Jan 2006 03:19:56 -0000 1.11 +++ Entity.vsl 31 Jan 2006 15:15:58 -0000 1.12 @@ -99,16 +99,15 @@ #set ($operations = $entity.businessOperations) #if (!$operations.empty) - // --------------- Business Methods ----------------- + // ------------------ Methods -------------------- #**##foreach ($operation in $operations) #* *##set ($signature = $operation.signature) -#* *##set ($interfaceType = "interface") #* *##set ($visibility = $operation.visibility.toString()) +#* *##set ($returnType = $operation.returnType.fullyQualifiedName) /** $operation.getDocumentation(" * ") */ -#* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##if ($operation.exceptionsPresent) $visibility $returnType $signature throws $operation.exceptionList @@ -124,6 +123,8 @@ // TODO put your implementation here. #* *##if ($operation.returnTypePresent) return $operation.returnType.javaNullString; +#* *##else + throw new java.lang.UnsupportedOperationException("${entity.fullyQualifiedName}.${operation.signature} Not implemented!"); #* *##end } #* *##end |
From: Vance K. <va...@us...> - 2006-02-01 08:36:32
|
User: vancek Date: 06/02/01 00:36:25 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: fixed entity method declaration Revision Changes Path 1.13 +9 -16 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -r1.12 -r1.13 --- Entity.vsl 31 Jan 2006 15:15:58 -0000 1.12 +++ Entity.vsl 1 Feb 2006 08:36:25 -0000 1.13 @@ -99,7 +99,7 @@ #set ($operations = $entity.businessOperations) #if (!$operations.empty) - // ------------------ Methods -------------------- + // -------------- Entity Methods ----------------- #**##foreach ($operation in $operations) #* *##set ($signature = $operation.signature) @@ -108,17 +108,10 @@ /** $operation.getDocumentation(" * ") */ + $visibility #if ($operation.static)static#end $returnType $signature #* *##if ($operation.exceptionsPresent) - $visibility $returnType $signature throws $operation.exceptionList - { - // TODO put your implementation here. -#* *##if ($operation.returnTypePresent) - return $operation.returnType.javaNullString; #* *##end - } -#* *##else - $visibility $returnType $signature { // TODO put your implementation here. #* *##if ($operation.returnTypePresent) @@ -127,7 +120,7 @@ throw new java.lang.UnsupportedOperationException("${entity.fullyQualifiedName}.${operation.signature} Not implemented!"); #* *##end } -#* *##end + #**##end #end } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-02-06 02:46:43
|
User: vancek Date: 06/02/05 18:46:38 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: removed accessType for @MappedSuperclass (formerly EmbeddableSuperclass) annotation, renamed @EntityListener to @EntityListeners, added @Transient annotation to entity methods Revision Changes Path 1.14 +4 -5 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -r1.13 -r1.14 --- Entity.vsl 1 Feb 2006 08:36:25 -0000 1.13 +++ Entity.vsl 6 Feb 2006 02:46:38 -0000 1.14 @@ -16,12 +16,10 @@ * */ - -...@ja...rsistence.Entity#if ($entity.accessType)(access = javax.persistence.AccessType.${entity.accessType})#end - +...@ja...rsistence.Entity @javax.persistence.Table(name = "${entity.tableName}") #if ($entity.listenerEnabled) -...@ja...rsistence.EntityListener(${entity.fullyQualifiedEntityListenerName}.class) +...@ja...rsistence.EntityListeners({${entity.fullyQualifiedEntityListenerName}.class}) #end public#if ($entity.abstract) abstract#end class ${entity.entityName} extends ${entity.fullyQualifiedEntityEmbeddableName} @@ -108,6 +106,7 @@ /** $operation.getDocumentation(" * ") */ + @javax.persistence.Transient $visibility #if ($operation.static)static#end $returnType $signature #* *##if ($operation.exceptionsPresent) throws $operation.exceptionList |
From: Vance K. <va...@us...> - 2006-03-05 05:51:58
|
User: vancek Date: 06/03/04 21:51:56 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: added support for lifecycle callbacks Revision Changes Path 1.15 +42 -8 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -r1.14 -r1.15 --- Entity.vsl 6 Feb 2006 02:46:38 -0000 1.14 +++ Entity.vsl 5 Mar 2006 05:51:55 -0000 1.15 @@ -100,6 +100,7 @@ // -------------- Entity Methods ----------------- #**##foreach ($operation in $operations) +#* *##if (!$operation.lifecycleCallback) #* *##set ($signature = $operation.signature) #* *##set ($visibility = $operation.visibility.toString()) #* *##set ($returnType = $operation.returnType.fullyQualifiedName) @@ -121,5 +122,38 @@ } #**##end +#**##end +#end +#if (!$operations.empty) + + // --------------- Lifecycle callbacks ----------------- + +#**##foreach ($operation in $operations) +#* *##if ($operation.lifecycleCallback) + /** +$operation.getDocumentation(" * ") + */ +#* *##if ($operation.prePersist) + @javax.persistence.PrePersist +#* *##elseif ($operation.postPersist) + @javax.persistence.PostPersist +#* *##elseif ($operation.preRemove) + @javax.persistence.PreRemove +#* *##elseif ($operation.postRemove) + @javax.persistence.PostRemove +#* *##elseif ($operation.preUpdate) + @javax.persistence.PreUpdate +#* *##elseif ($operation.postUpdate) + @javax.persistence.PostUpdate +#* *##elseif ($operation.postLoad) + @javax.persistence.PostLoad +#* *##end + public void ${operation.name}() + { + // TODO put your lifecycle callback implementation here. + } + +#* *##end +#**##end #end } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-04-11 15:39:59
|
User: vancek Date: 06/04/11 08:39:55 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: fixed comment spacing Revision Changes Path 1.16 +1 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -r1.15 -r1.16 |
From: Vance K. <va...@us...> - 2006-04-26 15:12:51
|
User: vancek Date: 06/04/26 08:12:41 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: added NamedQueries and NamedQuery annotations Revision Changes Path 1.17 +23 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -r1.16 -r1.17 --- Entity.vsl 11 Apr 2006 15:39:54 -0000 1.16 +++ Entity.vsl 26 Apr 2006 15:12:41 -0000 1.17 @@ -1,5 +1,8 @@ // license-header java merge-point -/* Autogenerated by AndroMDA (EntityImpl.vsl)*/ +// +// Attention: Generated code! Do not modify by hand! +// Generated by: Entity.vsl in andromda-ejb3-cartridge. +// #if ($stringUtils.isNotBlank($entity.packageName)) package $entity.packageName; #end @@ -21,6 +24,25 @@ #if ($entity.listenerEnabled) @javax.persistence.EntityListeners({${entity.fullyQualifiedEntityListenerName}.class}) #end +#set ($finders = $entity.getQueryOperations(false)) +#if (!$finders.empty) +...@ja...dQueries +({ +#**##if ($entity.genericFinders) + @javax.persistence.NamedQuery(name = "${entity.name}.findAll", query = "select $stringUtils.uncapitalize(${entity.name}) from ${entity.name} AS $stringUtils.uncapitalize(${entity.name})")#if (!$finders.empty),#end + +#**##end +#**##foreach ($finder in $finders) + @javax.persistence.NamedQuery(name = "${entity.name}.${finder.name}", query = "${finder.query}")#if($velocityCount != $finders.size()), #end + +#**##end +}) +#else +#**##if ($entity.genericFinders) +...@ja...dQuery(name = "${entity.name}.findAll", query = "select $stringUtils.uncapitalize(${entity.name}) from ${entity.name} AS $stringUtils.uncapitalize(${entity.name})")#if (!$finders.empty),#end + +#**##end +#end public#if ($entity.abstract) abstract#end class ${entity.entityName} extends ${entity.fullyQualifiedEntityEmbeddableName} implements java.io.Serializable |
From: Vance K. <va...@us...> - 2006-05-15 12:44:39
|
User: vancek Date: 06/05/15 05:44:38 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: enable cache support if required for mapped superclass with subclass hierarchy employed for entities. only add 1 findAll named query definition. Revision Changes Path 1.18 +14 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -r1.17 -r1.18 --- Entity.vsl 26 Apr 2006 15:12:41 -0000 1.17 +++ Entity.vsl 15 May 2006 12:44:38 -0000 1.18 @@ -23,12 +23,25 @@ @javax.persistence.Table(name = "${entity.tableName}") #if ($entity.listenerEnabled) @javax.persistence.EntityListeners({${entity.fullyQualifiedEntityListenerName}.class}) +#else +/** + * Uncomment to enable entity listener for ${entity.entityName} + * @javax.persistence.EntityListeners({${entity.fullyQualifiedEntityListenerName}.class}) + */ +#end +#if ($entity.cacheEnabled) +...@or...che(usage = org.hibernate.annotations.CacheConcurrencyStrategy.${entity.cacheType}) +#else +/** + * Uncomment to enable caching for ${entity.entityName} + * @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.${entity.cacheType}) + */ #end #set ($finders = $entity.getQueryOperations(false)) #if (!$finders.empty) @javax.persistence.NamedQueries ({ -#**##if ($entity.genericFinders) +#**##if ($entity.genericFinders && !$entity.finderFindAllExists) @javax.persistence.NamedQuery(name = "${entity.name}.findAll", query = "select $stringUtils.uncapitalize(${entity.name}) from ${entity.name} AS $stringUtils.uncapitalize(${entity.name})")#if (!$finders.empty),#end #**##end |