From: Vance K. <va...@us...> - 2007-02-28 00:56:18
|
User: vancek Date: 07/02/27 16:56:18 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl EntityEmbeddable.vsl Log: fix for constructor generation when no attributes modelled and operations exist Revision Changes Path 1.21 +5 -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.20 retrieving revision 1.21 diff -u -w -r1.20 -r1.21 --- Entity.vsl 1 Jul 2006 10:13:01 -0000 1.20 +++ Entity.vsl 28 Feb 2007 00:56:18 -0000 1.21 @@ -104,19 +104,20 @@ #set ($relations = $entity.allEntityRelations) #if (!$relations.empty) #**##if ($entity.syntheticCreateMethodAllowed) +#* *##set ($updatableAttributes = $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) /** * Constructor with all POJO attribute values and CMR relations. * -#* *##foreach($attribute in $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) +#* *##foreach($attribute in $updatableAttributes) * @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 + * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation #* *##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) + public ${entity.entityName}($entity.getAttributesAsList($allAttributes, true, true, false)#if(!$updatableAttributes.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); + super($entity.getAttributesAsList($updatableAttributes, false, true, false)#if(!$updatableAttributes.empty), #end#foreach ($relation in $relations)$relation.otherEnd.name#if($velocityCount != $relations.size()), #end#end); } #**##end 1.45 +11 -8 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityEmbeddable.vsl Index: EntityEmbeddable.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/EntityEmbeddable.vsl,v retrieving revision 1.44 retrieving revision 1.45 diff -u -w -r1.44 -r1.45 --- EntityEmbeddable.vsl 17 Feb 2007 14:09:08 -0000 1.44 +++ EntityEmbeddable.vsl 28 Feb 2007 00:56:18 -0000 1.45 @@ -43,9 +43,15 @@ #else @javax.persistence.Entity #**##if ($entity.seamComponent) -...@or...("${entity.seamComponentName}") +/** + * Use components.xml to define Seam components + * @org.jboss.seam.annotations.Name("${entity.seamComponentName}") + */ #* *##if ($stringUtils.isNotBlank($entity.seamComponentScopeType)) -...@or...ope(org.jboss.seam.ScopeType.${entity.seamComponentScopeType}) +/** + * Use components.xml to define Seam component scope type + * @org.jboss.seam.annotations.Scope(org.jboss.seam.ScopeType.${entity.seamComponentScopeType}) + */ #* *##end #**##end ## @@ -234,10 +240,7 @@ /** * Default empty constructor */ - public #if ($entity.entityImplementationRequired || $entity.embeddableSuperclass)${entity.entityEmbeddableName}#else${entity.entityName}#end() - { - // default null constructor - } + public #if ($entity.entityImplementationRequired || $entity.embeddableSuperclass)${entity.entityEmbeddableName}#else${entity.entityName}#end() {} ## Autogenerate a constructor implementation with all attributes. #set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) @@ -267,15 +270,15 @@ #set ($relations = $entity.allEntityRelations) #if (!$relations.empty) #**##if ($entity.syntheticCreateMethodAllowed) +#* *##set ($updatableAttributes = $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) /** * Constructor with all POJO attribute values and CMR relations. * -#* *##set ($updatableAttributes = $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) #* *##foreach($attribute in $updatableAttributes) * @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 + * @param $relation.otherEnd.name Value for the ${relation.otherEnd.name} relation #* *##end */ public #if ($entity.entityImplementationRequired || $entity.embeddableSuperclass)${entity.entityEmbeddableName}#else${entity.entityName}#end($entity.getAttributesAsList($allAttributes, true, true, false)#if(!$updatableAttributes.empty), #end#foreach ($relation in $relations)${relation.otherEnd.getterSetterTypeName} $relation.otherEnd.name#if($velocityCount != $relations.size()), #end#end) |