Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 51455 invoked from network); 25 May 2010 15:17:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 May 2010 15:17:06 -0000 Received: (qmail 25782 invoked by uid 500); 25 May 2010 15:17:05 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 25759 invoked by uid 500); 25 May 2010 15:17:05 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 25751 invoked by uid 99); 25 May 2010 15:17:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 May 2010 15:17:05 +0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=AWL,SPF_HELO_PASS,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 May 2010 15:17:00 +0000 Received: from jim.nabble.com ([192.168.236.80]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OGvrz-0000Gq-RC for users@openjpa.apache.org; Tue, 25 May 2010 08:16:39 -0700 Date: Tue, 25 May 2010 08:16:39 -0700 (PDT) From: Pinaki Poddar To: users@openjpa.apache.org Message-ID: <1274800599833-5098927.post@n2.nabble.com> In-Reply-To: <1274628983688-5091015.post@n2.nabble.com> References: <1274628983688-5091015.post@n2.nabble.com> Subject: Re: Bidirectional OneToMany with Enchancer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The application will need to set the bi-directional relation. One can do that consistently within the domain class itself or outside Inside the domain Parent.java public void setChildren(Set children) { for (Child c : children) c.setParent(this); this.children = children; } Or outside: Hospital.java // a non-persistent class void haveBabies(Parent p, Set children) { p.setChildren(children); for (Child c : children) c.setparent(p); } ----- Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Bidirectional-OneToMany-with-Enchancer-tp5091015p5098927.html Sent from the OpenJPA Users mailing list archive at Nabble.com.