• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in defining CMR. pls help............

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
reply
    Bookmark Topic Watch Topic
  • New Topic