Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 38127 invoked from network); 8 Jun 2010 03:28:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jun 2010 03:28:33 -0000 Received: (qmail 12649 invoked by uid 500); 8 Jun 2010 03:28:33 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 12456 invoked by uid 500); 8 Jun 2010 03:28:33 -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 12448 invoked by uid 99); 8 Jun 2010 03:28:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 03:28:32 +0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=SPF_HELO_PASS,SPF_NEUTRAL,T_FILL_THIS_FORM_SHORT,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.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, 08 Jun 2010 03:28:25 +0000 Received: from jim.nabble.com ([192.168.236.80]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OLpTw-0005eV-6t for users@openjpa.apache.org; Mon, 07 Jun 2010 20:28:04 -0700 Date: Mon, 7 Jun 2010 20:28:04 -0700 (PDT) From: Pinaki Poddar To: users@openjpa.apache.org Message-ID: <1275967684206-5152078.post@n2.nabble.com> In-Reply-To: References: <489AE806.4000001@gmx.net> <1218119992737-678742.post@n2.nabble.com> <1218125938789-679024.post@n2.nabble.com> <1218216300692-681198.post@n2.nabble.com> <1275927923318-5149822.post@n2.nabble.com> <1275938436966-5150661.post@n2.nabble.com> Subject: RE: bidirectional one-to-many relationship with join-table MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, 1. what is the settings for openjpa.jdbc.SynchronizeMappings property? 2. is there an existing schema? I ran your example as it is to define the schema on a MySQL databse. It ended up with three columns on PERSON_ADDRESSES join table CREATE TABLE person_addresses ( ADDRESS_PHONE VARCHAR(255), PERSON_SSN BIGINT, phone VARCHAR(255)) Quite possibly a bug. Editing line 03 of your mapping spec 01: @JoinTable(name="person_addresses", 02: joinColumns = @JoinColumn(name="person_ssn", referencedColumnName="ssn"), 03: inverseJoinColumns = @JoinColumn(name="phone", referencedColumnName="phone")) Edit line 03 to inverseJoinColumns = @JoinColumn(name="address_phone", referencedColumnName="phone")) Got rid of the third column on the join table. But obviously naming of join table's columns has a problem that requires further investigation. But see if the suggested edit helps. ----- Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/bidirectional-one-to-many-relationship-with-join-table-tp678479p5152078.html Sent from the OpenJPA Users mailing list archive at Nabble.com.