Hello AndroMDA users,

I have some issues using the AndroMDA Spring Cartridge. To be honest, I
haven's searched Jira and the mailinglist after any hints very detailed -
so please excuse me if I ask a FAQ. Also, I haven't checkt it with the
current snapshot jet - sorry.


The Problem:
I'm using AndroMDA 3.1 M1 with JDK 1.5.0_03 and MagicDraw 9.5.
I have a model like this: (Backround: Library Maintainance, and sorry for
the german words)


abstract class Printmedium
class Magazin extends Printmedium
class Buch extends Printmedium


class Verlag


Association Printmedium -*--1-> Verlag


Starting a build will then fail due to a compiler failure:


    [javac] Compiling 36 source files to H:
\Projekte-01\RichClients\Diplomarbeit\Entwicklung\live\core\target\classes
H:
\Projekte-01\RichClients\Diplomarbeit\Entwicklung\live\core\target\src\de\opitzconsulting\live\entities\MagazinDaoBase.java:159:

cannot find symbol
symbol  : method
create(int,de.opitzconsulting.live.entities.Verlag,int,int,java.lang.String,java.lang.String)

location: class de.opitzconsulting.live.entities.MagazinDaoBase
       return
(de.opitzconsulting.live.entities.Printmedium)this.create(TRANSFORM_NONE,
verlag, jahr, nummer, titel, sprache);
                                                            ^
H:
\Projekte-01\RichClients\Diplomarbeit\Entwicklung\live\core\target\src\de\opitzconsulting\live\entities\BuchDaoBase.java:155:

cannot find symbol
symbol  : method
create(int,de.opitzconsulting.live.entities.Verlag,java.lang.String,java.lang.String,java.lang.String)

location: class de.opitzconsulting.live.entities.BuchDaoBase
       return
(de.opitzconsulting.live.entities.Printmedium)this.create(TRANSFORM_NONE,
verlag, titel, sprache, isbn);
                                                            ^
The reason seems to be a wrong order of the parameters, e.g. BuchDaoBase:


    /**
    * @see
de.opitzconsulting.live.entities.BuchDao#create(java.lang.String,
java.lang.String, de.opitzconsulting.live.entities.Verlag,
java.lang.String)
    */
   public de.opitzconsulting.live.entities.Printmedium create(
       java.lang.String titel,
       java.lang.String sprache,
       de.opitzconsulting.live.entities.Verlag verlag,
       java.lang.String isbn)
   {
       return
(de.opitzconsulting.live.entities.Printmedium)this.create(TRANSFORM_NONE,
verlag, titel, sprache, isbn);
   }


The order of the Parameters in the javadoc and the method signature is
"String, String, Verlag, String", the ordering in the method body is
"Verlag, String, String, String".


If you take a look at generating template SpringHibernateDaoBase.vsl, the
relevant peace of code seems to be this:


---Line 188:---
#set ($requiredProperties = $entity.getRequiredProperties(true,false))
#if (!$requiredProperties.empty &&
$entity.getRequiredAttributes(true,false).size() !
= $requiredProperties.size())
   /**
    * @see ${entity.fullyQualifiedDaoName}#create
(${entity.getRequiredPropertyTypeList(true, false)})
    */
   public $entity.root.fullyQualifiedEntityName create(
#foreach($property in $requiredProperties)
       $property.getterSetterTypeName $property.name#if($velocityCount !
= $requiredProperties.size()),#else)#end


#end
   {
       return ($entity.root.fullyQualifiedEntityName)this.create
($entity.daoNoTransformationConstantName,
${entity.getRequiredPropertyNameList(true,false)});
   }


So the metafacade methods getRequiredPropertyTypeList and
getRequiredProperties on one hand and getRequiredPropertyNameList on the
other hand seems to provide the required properties in different order.


An soon as I change the multiplicity of my association on the Verlag-side
to "0..1" (instead of "1"), everything works fine.


Any ideas?


Stefan






-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to