From: Vance K. <va...@us...> - 2006-06-26 14:21:55
|
User: vancek Date: 06/06/26 07:21:51 Modified: andromda-ejb3/src/changes changes.xml andromda-ejb3/src/main/resources/templates/ejb3 EntityEmbeddable.vsl Log: fix JIRA EJB-34 - invalid entity constructure signature if the entity is without attributes but contains navigable associations Revision Changes Path 1.10 +4 -0 cartridges/andromda-ejb3/src/changes/changes.xml Index: changes.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/changes/changes.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -r1.9 -r1.10 --- changes.xml 26 Jun 2006 06:53:33 -0000 1.9 +++ changes.xml 26 Jun 2006 14:21:50 -0000 1.10 @@ -169,6 +169,10 @@ set. EJB3ManageableEntityAttributeFacade also extends EJB3EntityAttributeFacade. This eliminates the need for the existing overwritten methods in the manageable entity facades. </action> + <action dev="vancek" due-to="tlu" type="fix"> + Fix erroneous signature of entity constructor where no entity attributes exist but navigable associations + do exist. + </action> </release> </body> </document> \ No newline at end of file 1.34 +8 -7 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.33 retrieving revision 1.34 diff -u -w -r1.33 -r1.34 --- EntityEmbeddable.vsl 26 Jun 2006 06:37:12 -0000 1.33 +++ EntityEmbeddable.vsl 26 Jun 2006 14:21:51 -0000 1.34 @@ -239,7 +239,8 @@ * This method sets all POJO fields defined in this class to the values provided by * the parameters. * -#**##foreach($attribute in $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) +#**##set ($updatableAttributes = $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) +#**##foreach($attribute in $updatableAttributes) * @param $attribute.name Value for the ${attribute.name} property #**##end */ @@ -248,7 +249,7 @@ #**##if(!$inheritedAttributes.empty) super($entity.getAttributesAsList($inheritedAttributes, false, true, false)); #**##end -#**##foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes, $entity.compositePrimaryKeyPresent)) +#**##foreach ($attribute in $updatableAttributes) ${attribute.setterName}(${attribute.name}); #**##end } @@ -260,20 +261,20 @@ /** * Constructor with all POJO attribute values and CMR relations. * -#* *##foreach($attribute in $transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent)) +#* *##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 #* *##end */ - public #if ($entity.entityImplementationRequired || $entity.embeddableSuperclass)${entity.entityEmbeddableName}#else${entity.entityName}#end($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 #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) { -#* *##foreach ($attribute in $transform.filterUpdatableAttributes($instanceAttributes, $entity.compositePrimaryKeyPresent)) +#* *##foreach ($attribute in $updatableAttributes) ${attribute.setterName}(${attribute.name}); #* *##end - // Set the CMR relations #* *##foreach ($relation in $relations) ${relation.otherEnd.setterName}($relation.otherEnd.name); #* *##end |