From open-jpa-dev-return-2928-apmail-incubator-open-jpa-dev-archive=incubator.apache.org@incubator.apache.org Wed Mar 28 17:36:31 2007 Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 62749 invoked from network); 28 Mar 2007 17:36:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2007 17:36:30 -0000 Received: (qmail 2242 invoked by uid 500); 28 Mar 2007 17:36:37 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 2217 invoked by uid 500); 28 Mar 2007 17:36:37 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 2208 invoked by uid 99); 28 Mar 2007 17:36:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2007 10:36:37 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of plinskey@bea.com designates 66.248.192.39 as permitted sender) Received: from [66.248.192.39] (HELO repmmg02.bea.com) (66.248.192.39) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2007 10:36:28 -0700 Received: from repmmr01.bea.com (repmmr01.bea.com [10.160.29.71]) by repmmg02.bea.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2SHZHuN017703 for ; Wed, 28 Mar 2007 10:36:04 -0700 Received: from repbex02.amer.bea.com (repbex02.bea.com [10.160.26.99]) by repmmr01.bea.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2SHZGgL031303 for ; Wed, 28 Mar 2007 10:36:04 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: RE: composite ID based on "one" side of a bidirectional one-many relationship Date: Wed, 28 Mar 2007 10:33:48 -0700 Message-ID: <7D856CDFE035FF45A0420ACBD71BDD6303AEC715@repbex02.amer.bea.com> In-Reply-To: <829788.72405.qm@web39503.mail.mud.yahoo.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: composite ID based on "one" side of a bidirectional one-many relationship Thread-Index: AcdxXuyPXRKeXOZwSbqoeAPzIF5Q2wAAEfiw References: <7D856CDFE035FF45A0420ACBD71BDD6303AEC407@repbex02.amer.bea.com> <829788.72405.qm@web39503.mail.mud.yahoo.com> From: "Patrick Linskey" To: x-BEA-PMX-Instructions: AV x-BEA-MM: Internal-To-External X-Virus-Checked: Checked by ClamAV on apache.org Yes, please do. It looks like your code should work. -Patrick -- Patrick Linskey BEA Systems, Inc. _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. > -----Original Message----- > From: jeff [mailto:jeffrey.blattman@yahoo.com] > Sent: Wednesday, March 28, 2007 10:31 AM > To: open-jpa-dev@incubator.apache.org > Subject: RE: composite ID based on "one" side of a > bidirectional one-many relationship > > yes, i see the problem w/ the attached classes, and with a > completely different model where i am trying to accomplish > the same thing. > > should i file a bug? i can attach the test case there. > > Patrick Linskey wrote: Are you still > seeing that same problem with the code that you attached? > > -Patrick > > -- > Patrick Linskey > BEA Systems, Inc. > > ______________________________________________________________ > _________ > Notice: This email message, together with any attachments, > may contain > information of BEA Systems, Inc., its subsidiaries and > affiliated > entities, that may be confidential, proprietary, > copyrighted and/or > legally privileged, and is intended solely for the use of the > individual > or entity named in this message. If you are not the intended > recipient, > and have received this message in error, please immediately > return this > by email and then delete it. > > > -----Original Message----- > > From: jeff [mailto:jeffrey.blattman@yahoo.com] > > Sent: Tuesday, March 27, 2007 1:42 PM > > To: open-jpa-dev@incubator.apache.org > > Subject: RE: composite ID based on "one" side of a > > bidirectional one-many relationship > > > > Patrick Linskey > wrote: > > > > > my ID class has a book field, and getters and setters for it > > > to match Page's book field. i wonder about the last line > > > where it says "java.lang.String". that seems odd. > > > > Can you post your Book and Page classes and the Page's IdClass? > > > > > > attached. i keep trying to attach the entire project as a > > zip, but apache's spam filter keeps dropping it. let me know > > i could send to you directly. > > > > > > > so, regardless, even if that did work, correct me if i am > > > wrong, but it'd be a really bad idea to depend on openjpa > > > specifics, because my app doesn't get to choose the JPA > > > implementation, it has to use whatever the java ee container > > > gives it ... right? > > > > No -- a Java EE 5 container *must* allow you to specify > > your persistence > > provider. Whatever you put in the element in the > > persistence.xml must be obeyed. Only if you do not specify a > > element can the implementation can choose whatever it > > wants to use. > > > > > > yes, duh. sorry. > > > > > > > > Correct. > > > > > so, assuming i do need to accomplish this, is there a best > > > practice? as i mentioned, what i did to make it work was make > > > the Page's composite ID incorporate the Book's ID by adding a > > > "derived" bookName field to Page, like ... > > > > You could add a private bookName field that has no > > external mutators or > > accessors, and create a @PreStore callback that copies > > the value from > > the related Book into the field. That would do a decent > > job of isolating > > the artifact from the rest of your app. > > > > > > yes, that works. > > > > ________________________________ > > > > Finding fabulous fares is fun. > > Let Yahoo! FareChase search your favorite travel sites > > > FtNW45amVpBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzEEc2VjA21haWx0 > YWdsaW5lBH > NsawNxMS0wNw--> to > find flight and hotel bargains. > > > > Notice: This email message, together with any attachments, > may contain information of BEA Systems, Inc., its > subsidiaries and affiliated entities, that may be > confidential, proprietary, copyrighted and/or legally > privileged, and is intended solely for the use of the > individual or entity named in this message. If you are not > the intended recipient, and have received this message in > error, please immediately return this by email and then delete it. > > > > > --------------------------------- > Food fight? Enjoy some healthy debate > in the Yahoo! Answers Food & Drink Q&A. > Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.