Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 95385 invoked from network); 30 May 2007 11:15:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 May 2007 11:15:06 -0000 Received: (qmail 65757 invoked by uid 500); 30 May 2007 11:15:05 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 65749 invoked by uid 500); 30 May 2007 11:15:04 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 65738 invoked by uid 99); 30 May 2007 11:15:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 May 2007 04:15:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [211.29.132.199] (HELO mail18.syd.optusnet.com.au) (211.29.132.199) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 May 2007 04:14:58 -0700 Received: from [192.169.0.4] (d58-106-5-23.mas2.nsw.optusnet.com.au [58.106.5.23]) (authenticated sender gianny.damour) by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id l4UBEZtf027057 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 30 May 2007 21:14:36 +1000 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <20070529080710.181451e9c2a7ebbcd6ae28cea81146c8.ba8cb68a1b.wbe@email.secureserver.net> References: <20070529080710.181451e9c2a7ebbcd6ae28cea81146c8.ba8cb68a1b.wbe@email.secureserver.net> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <98507EAE-0DA3-4EAF-8563-DA26F18D0CED@optusnet.com.au> Content-Transfer-Encoding: 7bit From: Gianny Damour Subject: Re: EJB 2.1 CMR Bi-Directional with Compound Key Date: Wed, 30 May 2007 21:07:36 +1000 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org Hi Mark, I had a look to the openejb-jar DD and I think you need to drop the element from the Committee- CommitteeMembers relation. This optional element means that the foreign key columns declared in the following elements are defined by the CMP declared by . So, this should work: Committee-CommitteeMembers Committee-has-many-CommitteeMembers CommitteeEntity committeeMembers CommitteeId CommitteeId 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. Thanks, Gianny On 30/05/2007, at 1:07 AM, Mark Aufdencamp wrote: > I could really use some help on this! I have a two Entity beans > with a bi-directional relationship, committees and > committee_members. Committees has a single field primary key of > committeeId. Committee_members has a compound primary key of > CommitteeId+UserId. A Foreign Key constraint has been defined for > the committee_members table based on the committeeId. I can't seem > to get this to deploy and believe it's my openejb-jar.xml > deployment descriptor in the section. I've looked > at examples from JBoss and Sun, so I'm fairly certain my ejb- > jar.xml is correct. > > Does anyone have a working example of a bi-directional relatioship > where the many table has a compound key that I can take a look at? > > Where can I find documentation on how OpenEJB and TranQL interact > to create the O/R map? > > This knowledge are really seems to be lacking documentation in > Geronimo. I'd really like to draw some pretty pictures of tables > and beans with the seven different relationship types defined for > EJB 2.1. This would be good preliminary work for documenting EJB > 3.0 examples. Please help me learn, so I can contribute:) > > TIA, > Mark Aufdencamp > Mark@Aufdencamp.com