• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

EJB Relation Question

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two many to many cmp entity beans.
a userbean,a rolebean.
There are three tables in database:usertable,
roletable,userrolemaptable.
The PK of userrolemaptable is two fk:userid,
roleid.
Now i want to update the userrolemaptable.
How can i do it?I haven't the userrolemapbean.
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would check your vendors documentation for either many-to-many unidirectional or bidirectional relationship. The EJB spec has some material on it in chapter 10.5 but vendor docs will probably be more useful.
 
Sam Wang
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Last night,i had finished my work and i understood
my problem.Also thanks for your reply.
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stub Wang, can you post your solution here too?
 
Sam Wang
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Caroline Iux,if u use cmp,it's very convenience
to deal with m:n relations.
To tell u the truth,I'm not familiar with deploy
description.I finish this work under the help of
jbuilder's ejbmodule.From ejb-jar.xml:
<ejb-relation>
<ejb-relation-name>userEntity-roleEntity</ejb-relation-name>
<ejb-relationship-role>
<description>userEntity</description>
<ejb-relationship-role-name>UserEntityRelationshipRole</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<description>userEntity</description>
<ejb-name>UserEntity</ejb-name>
</relationship-role-source>
<cmr-field>
<description>roleEntity</description>
<cmr-field-name>roleEntity</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<description>roleEntity</description>
<ejb-relationship-role-name>RoleEntityRelationshipRole</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<description>roleEntity</description>
<ejb-name>RoleEntity</ejb-name>
</relationship-role-source>
<cmr-field>
<description>userEntity</description>
<cmr-field-name>userEntity</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
</relationships>
From weblogic-cmp-rdbms-jar.xml:
<weblogic-rdbms-relation>
<relation-name>userEntity-roleEntity</relation-name>
<table-name>BZUSERROLEMAPTB</table-name>
<weblogic-relationship-role>
<relationship-role-name>UserEntityRelationshipRole</relationship-role-name>
<column-map>
<foreign-key-column>USERID</foreign-key-column>
<key-column>USERID</key-column>
</column-map>
</weblogic-relationship-role>
<weblogic-relationship-role>
<relationship-role-name>RoleEntityRelationshipRole</relationship-role-name>
<column-map>
<foreign-key-column>ROLEID</foreign-key-column>
<key-column>ROLEID</key-column>
</column-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
May this help u.
 
Legend has it that if you rub the right tiny ad, a genie comes out.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic