[ http://jira.andromda.org/browse/EJB-71?page=comments#action_15200 ]
Timo Reichert commented on EJB-71: ---------------------------------- Looks as if there is now a new bug. For each property, there is a converter method creates as target.setXyz(source.getPk().getXyz()); Regardless of whether the property is a identifier or not! Take the example above: <<Entity>> Person <<Identifier>> +id : Long <<Identifier>> +tag : String +name : String || V <<ValueObject>> PersonVO +id : Long +tag : String +name : String the cartridge generate the following method: public void toPersonVO(Person source, PersonVO target) ... target.setId(source.getPk().getId()); //OK! target.setTag(source.getPk().getTag()); //OK! target.setName(source.getPk().getName()); //FALSE! } > Composite <<Identifier>> and Value Object > ----------------------------------------- > > Key: EJB-71 > URL: http://jira.andromda.org/browse/EJB-71 > Project: EJB Cartridge > Type: Bug > Reporter: Luca Dall'Olio > Assignee: Vance Karimi > > Mapping a composite PK using <<Identifier>> stereotype somehow breaks > creation of <<ValueObject>>, since every field having the <<Identifier>> > stereotype is created inside a PK embedded object, so the > Entity-To-ValueObject conversion template cannot locate it. > Example : > <<Entity>> > Person > <<Identifier>> +id : Long > <<Identifier>> +tag : String > || > || > || > \/ > <<ValueObject>> > PersonVO > +id : Long > +tag : String > throws a "cannot find symbol : method getId() ... cannot find symbol : method > getTag()" > in class PersonDaoBase : > public void toPersonVO(Person source, PersonVO target) > ... > target.setId(source.getId()); > target.setTag(source.getTag()); > } > these field are in fact generated inside PersonPK, so code should be like > this : > public void toPersonVO(Person source, PersonVO target) > ... > target.setId(source.getPk().getId()); > target.setTag(source.getPk().getTag()); > } > This forum topic is about the same problem: > http://galaxy.andromda.org/forum/viewtopic.php?t=4937 -- 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: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/