geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Aufdencamp <>
Subject RE: EJB 2.1 CMR Bi-Directional with Compound Key
Date Wed, 30 May 2007 19:54:46 GMT
Thanks for the response Gianny.&nbsp; I've wacked out a small demo that
I'm working on right now with a session facade, the three beans, and the database tables.&nbsp;
I'll let you all know how it goes:)</div>
I'm planning on hittting EJB 3.0 hard once I understand this.&nbsp; I
want to comprehend the legacy way first!<BR></div>
<div   name="wmMessageComp"><BR><BR>
<BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid" webmail="1">--------
Original Message --------<BR>Subject: Re: EJB 2.1 CMR Bi-Directional with Compound Key<BR>From:
Gianny Damour &lt;;<BR>Date: Wed, May 30, 2007
7:07 am<BR>To:<BR><BR><PRE>Hi Mark,

I had a look to the openejb-jar DD and I think you need to drop the  
&lt;foreign-key-column-on-source/&gt; element from the Committee- 
CommitteeMembers relation. This optional element means that the  
foreign key columns declared in the following &lt;cmr-field-mapping&gt;  
elements are defined by the CMP declared by &lt;relationship-role-source&gt;.

So, this should work:



Also, you do not need to declare both sides of a relationship: the  
above is enough to declare the CMR mapping for the Committee- 
CommitteeMembers relation.

BTW, I strongly recommend you to upgrade to OpenEJB3: this should be  
a seamless migration from a CMP perspective as the OpenEJB guys have  
done a fantastic work at writing an OpenEJB2 schema converter.


On 30/05/2007, at 1:07 AM, Mark Aufdencamp wrote:

&gt; I could really use some help on this!  I have a two Entity beans  
&gt; with a bi-directional relationship, committees and  
&gt; committee_members.  Committees has a single field primary key of  
&gt; committeeId.  Committee_members has a compound primary key of  
&gt; CommitteeId+UserId.  A Foreign Key constraint has been defined for  
&gt; the committee_members table based on the committeeId.  I can't seem  
&gt; to get this to deploy and believe it's my openejb-jar.xml  
&gt; deployment descriptor in the &lt;relationship&gt; section.  I've looked 

&gt; at examples from JBoss and Sun, so I'm fairly certain my ejb- 
&gt; jar.xml is correct.
&gt; Does anyone have a working example of a bi-directional relatioship  
&gt; where the many table has a compound key that I can take a look at?
&gt; Where can I find documentation on how OpenEJB and TranQL interact  
&gt; to create the O/R map?
&gt; This knowledge are really seems to be lacking documentation in  
&gt; Geronimo.  I'd really like to draw some pretty pictures of tables  
&gt; and beans with the seven different relationship types defined for  
&gt; EJB 2.1.  This would be good preliminary work for documenting EJB  
&gt; 3.0 examples.  Please help me learn, so I can contribute:)
&gt; TIA,
&gt; Mark Aufdencamp
&gt; <A onclick="Popup.composeWindow('pcompose.php?');
return false;" href=";type=reply&amp;folder=INBOX.Apache.Geronimo.Users&amp;uid=108#Compose">Mark<B></B></A>


View raw message