Hi donkoder:

I'm using AndroMDA-3.0-RC1-SNAPSHOT too and I received the same error. 

I fixed the error (sorry about my ugly solution):

1.- I "unzip" the file andromda-ejb-cartridge-3.0-RC1-SNAPSHOT.jar in
the andromda lib folder.

2.- I changed in the EntityBean.vsl file the lines:
----------------------------------------------------------------------
lines 701 - 705
#foreach ($attr in $reference.getAttributes(true))
#if ($entity.isAttributePresent($attr.name) ||
$entity.isOperationPresent($attr.getterName))
        valueObject.${attr.setterName}(${attr.getterName}());
#end
#end

for:
------------
#foreach ($attr in $reference.attributes)
#if ($entity.isAttributePresent($attr.name) ||
$entity.isOperationPresent($attr.getterName))
#foreach ($entity_attr in $entity.attributes) 
#if ($entity_attr.name == $attr.name)
        valueObject.${attr.setterName}(${entity_attr.getterName}());
#end
#end
#end
#end

3.- Afterwards, I packed again the cartridge and rebuild the project.


Best Regards
ericfle


----------------------------------------------------------------------------
Date: Wed, 9 Feb 2005 22:08:26 +0100 (CET)
From: Don Code <[EMAIL PROTECTED]>
To: andromda-user@lists.sourceforge.net
Subject: [Andromda-user] ERROR in template EntityBean.vsl generating
accessor for boolean property

Hi,

I am using AndroMDA-3.0-RC1-SNAPSHOT and I have a
ValueRef to a ValueObject wich have a boolean
attribute. The generated getter for the boolear is
prefixed with "is" as you already know, but...

>From EntityBean.vsl line 693-707

   // ---------------- accessor methods for bean
references ---------------
#foreach ($valueRef in $entity.valueDependencies)
#set ($reference = $valueRef.targetElement)
   /**
    * @ejb.interface-method
    */
    public ${reference.fullyQualifiedName}
get${reference.name}() {
        ${reference.fullyQualifiedName} valueObject =
new ${reference.fullyQualifiedName}();
#foreach ($attr in $reference.getAttributes(true))
#if ($entity.isAttributePresent($attr.name) ||
$entity.isOperationPresent($attr.getterName))

valueObject.${attr.setterName}(${attr.getterName}());
#end
#end
       return valueObject;
    }

valueObject.${attr.setterName}(${attr.getterName}());
is generating the getter name from the ValueObject
("is") instead of the right getterName for the entity
which must be "get"

I'm wrong about that observation?

The other reference lines are 38-53 in the source file
AttributeFacadeLogicImpl.java

   /**
    * @see
org.andromda.metafacades.uml.AttributeFacade#getGetterName()
    */
   public java.lang.String handleGetGetterName()
   {
       String prefix = null;
       if (getType() != null)
       {
           prefix = UMLMetafacadeUtils.isType(
               getType(),
               UMLProfile.BOOLEAN_TYPE_NAME) ? "is" :
"get";
       }

       return StringUtils.trimToEmpty(prefix)
           + StringUtils.capitalize(this.getName());
   }

Why is the reason to have a diference with the boolean
attributes?

Sorry about my bad english.

Regards,
 Donko

Attachment: EntityBean.vsl
Description: application/cnet-vsl

Reply via email to