From: Vance K. <va...@us...> - 2006-01-29 03:20:10
|
User: vancek Date: 06/01/28 19:19:56 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl EntityEmbeddable.vsl Log: add the all-attribute-inclusive constructor (less auto incremented identifiers) only if attributes exists. Revision Changes Path 1.11 +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.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- Entity.vsl 29 Jan 2006 01:47:59 -0000 1.10 +++ Entity.vsl 29 Jan 2006 03:19:56 -0000 1.11 @@ -45,9 +45,9 @@ ## Autogenerate a constructor implementation with all attributes. #set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) -#if ($entity.syntheticCreateMethodAllowed) +#if ($entity.syntheticCreateMethodAllowed && !$transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent).empty) /** - * Implementation for the constructor with all POJO attributes. + * Implementation for the constructor with all POJO attributes except auto incremented identifiers. * This method sets all POJO fields defined in this/super class to the * values provided by the parameters. * 1.11 +4 -4 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.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- EntityEmbeddable.vsl 29 Jan 2006 01:47:59 -0000 1.10 +++ EntityEmbeddable.vsl 29 Jan 2006 03:19:56 -0000 1.11 @@ -129,11 +129,11 @@ #set ($allAttributes = $transform.filterByVisibility($entity.allInstanceAttributes, "public")) #set ($inheritedAttributes = $transform.filterByVisibility($entity.inheritedInstanceAttributes, "public")) #set ($instanceAttributes = $transform.filterByVisibility($entity.instanceAttributes, "public")) -#if ($entity.syntheticCreateMethodAllowed) +#if ($entity.syntheticCreateMethodAllowed && !$transform.filterUpdatableAttributes($allAttributes, $entity.compositePrimaryKeyPresent).empty) /** - * Implementation for the constructor with all POJO attributes. - * This method sets all POJO fields defined in this class to the - * values provided by the parameters. + * Implementation for the constructor with all POJO attributes except auto incremented identifiers. + * 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)) * @param $attribute.name Value for the ${attribute.name} property |