Re: CMR/CMP Problem

"M.-Leander Reimer" <[email protected]>
Newsgroups gmane.comp.java.ejb.middlegen.user
Organization Techdivision GdbR
Message-ID <[email protected]>
Hi Leslie,

had the same problem under JBOss. Basically the problem is in the setVO 
methods of the CMP classes generated by XDoclet where the CMR fields of 
the entity are modified which is not allowed when you are creating an 
entity. You can always use the light value objects and set any FKs in 
there to create an entity (works under JBoss).

I guess the ejbCreate(VO) methods should be removed from the Middlegen 
template all together since they'll never work as far as I can tell.

Leander


Leslie Hughes schrieb:
> Hi, 
> 
> I'm getting a CMR/CMP problem when I try to call create with a VO instance.
> 
> In the Middlegen generated ejbCreate method (which takes a VO as a param)
> the generated code is calling a setter on a CMP field that holds the FK.In
> other words, instead of setting the relationship in the ejbPostCreate via a
> Local to the other bean, it's trying to set the (integer) FK directly with
> something like setFoo(vo.getFoo()).  This causes Weblogic to complain at
> runtime.
> 
> If I set FKCMP="false" then I get compilation errors - the same copy from VO
> create code is generated and setters are being called but of course, the
> setter itself isnt generated.
> 
> If I comment out the setters everything works just fine.
> 
> So I guess this is a bug in Middlegen - it shouldn't be generating VO fields
> for CMR fields maybe?
> 
> 
> Bye
> 
> Les
> 
> 
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> middlegen-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/middlegen-user



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.