This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Relation Question

 
Sam Wang
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Jim Baiter
Ranch Hand
Posts: 532
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Last night,i had finished my work and i understood
my problem.Also thanks for your reply.
 
Caroline Iux
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stub Wang, can you post your solution here too?
 
Sam Wang
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic