Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in defining CMR. pls help............  RSS feed

 
Tomson Antony
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I am facing a problem while defining cmr.
I am having two local entity beans VendorBean and AddressBean.
The prim key (vendorId) of VendorBean is the foreign key for the AddressBean with same name(vendorId).I defined the relation as one to one unidirectional to the VendorBean. ie,
accessor methods are in VendorBean which returns & sets AddressLocal. And there is accessor methods for the foreign key of AccessorBean.
Now the problem is while i am invoking setVendorId(id)from ejbCreate (), i am getting an exception
"When a cmp-field and a cmr-field (relationship) are mapped to the same column, the setXXX method for the cmp-field may not be called. The cmp-field is read-only." So i removed the setVendorId () from ejbCreate , its working but i want to set the foreign key also. So how can i do it?
PLS SOME ONE HELP ME, and its too urgent.
Thanks in advance.
Relation descriptor

<ejb-relation>
<ejb-relation-name>Vendor-CTPATAddress</ejb-relation-name>
<ejb-relationship-role>
<description>vendor</description>
<ejb-relationship-role-name>VendorRelationshipRole</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<description>vendor</description>
<ejb-name>Vendor</ejb-name>
</relationship-role-source>
<cmr-field>
<description>cTPATAddress</description>
<cmr-field-name>cTPATAddress</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<description>cTPATAddress</description>
<ejb-relationship-role-name>CTPATAddressRelationshipRole</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<description>cTPATAddress</description>
<ejb-name>CTPATAddress</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>

And weblogic relation descriptor

<weblogic-rdbms-relation>
<relation-name>vendor-vendorCTPATAddress</relation-name>
<weblogic-relationship-role>
<relationship-role-name>VendorCTPATAddressRelationshipRole</relationship-role-name>
<column-map>
<foreign-key-column>VENDORID</foreign-key-column>
<key-column>VENDORID</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!