[ http://jira.andromda.org/browse/SPRING-137?page=comments#action_12629 ] 

Wouter Zoons commented on SPRING-137:
-------------------------------------

I'm not sure what the best way is to fix this .. I've never ran into this issue 
before, if you find a good way to solve it I'm happy to apply a patch. 
Unfortunately I don't have that much time to look into this problem myself at 
this time.

> Many-to-many association and map association
> --------------------------------------------
>
>          Key: SPRING-137
>          URL: http://jira.andromda.org/browse/SPRING-137
>      Project: Spring Cartridge
>         Type: Bug

>   Components: CRUD
>     Versions: 3.1
>  Environment: AndroMDA 3.1, MagicDraw 9.5, Maven 1.0.2
>     Reporter: Sebastien Arbogast
>     Assignee: Wouter Zoons

>
> I've got 2 entities, let's say A and B, associated together with a 
> many-to-many (0..* - 0..*) association. But the B association end is tagged 
> to be defined as a map (@andromda.hibernate.collection.type=map). When I try 
> to compile that model, I get 5 compilation errors in 
> $PROJECT_HOME$/core/target/src/$MY_PACKAGE$/crud/ADaoBase.java
> and $PROJECT_HOME$/core/target/src/$MY_PACKAGE$/crud/BDaoBase.java because of 
> lines where the add method is called on a Map instance.
> Before that, the association between A and B was one-to-many and I had no 
> problem. 
> I think I found the incriminated lines (in AndroMDA 3.1 sources) in the 
> templates but I can't figure out how to correct them :
> - In 
> cartridges\andromda-spring\src\templates\spring\crud\SpringCrudDaoBase.vsl, 
> line 102, there should be a test to check the type of the corresponding 
> association, and if it is a Map, one should replace the "add()" call by a 
> "put()" which implies that we must be able to get the key value somewhere
> - In 
> cartridges\andromda-spring\src\templates\spring\crud\SpringCrudServiceBase.vsl,
>  line 164, there should be a test on the association type too.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

Reply via email to