Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 90917 invoked from network); 27 Jul 2007 06:25:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jul 2007 06:25:00 -0000 Received: (qmail 65396 invoked by uid 500); 27 Jul 2007 06:25:01 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 65367 invoked by uid 500); 27 Jul 2007 06:25:00 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 65357 invoked by uid 99); 27 Jul 2007 06:25:00 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2007 23:25:00 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of plinskey@gmail.com designates 64.233.166.180 as permitted sender) Received: from [64.233.166.180] (HELO py-out-1112.google.com) (64.233.166.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 06:24:54 +0000 Received: by py-out-1112.google.com with SMTP id f31so1484779pyh for ; Thu, 26 Jul 2007 23:24:32 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IFaOyZ2AFSMG4jsa8gIJ5GdqrCCXdVHmAXx/Q6XAmHj+POp0ClO/NVItCmIVvXhPyoqK8zKVDkxU0dlDoB5DVPawHnbwbuIz9sqgB97S6Agk2syoq/TQJ4CufRk9ILKJoXc7CM6WVAFYZxiLl52TY0x+/yX8PBO+pO/X53fuR9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=l3VDf6O2BdOpd5cBBJYO5fIgudfVO9ZrAiy1jNRZzjVcYMXptRgp4SdI461ArrTg8CzigK8ClnHpsequfqYK3G0Xvw+B15NxX2yAU64YOeW+eGhA9AxQl9eCtmG4nSfRtB7ZIB+cqYBOsy1hNksBHYnMaiuHTRMG7cbe7gtvy5c= Received: by 10.35.86.12 with SMTP id o12mr12733807pyl.1185517471951; Thu, 26 Jul 2007 23:24:31 -0700 (PDT) Received: by 10.35.8.4 with HTTP; Thu, 26 Jul 2007 23:24:31 -0700 (PDT) Message-ID: <7262f25e0707262324q3c8b1092y4d027a62429337d5@mail.gmail.com> Date: Thu, 26 Jul 2007 23:24:31 -0700 From: "Patrick Linskey" To: dev@openjpa.apache.org Subject: Re: How to map multiple properties to same column as writable in jpa In-Reply-To: <11822480.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11822480.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, This forum is for the OpenJPA product, so we don't have much experience with Toplink. However, from an OpenJPA standpoint, you can map the same column to multiple fields without a problem, as long as you don't attempt to set the fields to different values during the same transaction. -Patrick On 7/26/07, saravanan_tvm wrote: > > Hi, > I am using toplink from oracle to support JPA. > I have the following requirement... > i have to map same column for multiple properties using @joincolumn > annotation.. eg its something like this > > @joincolumn(name="PARENT_RECORD_ID") > private Drug drug > > @joincolumn(name="PARENT_RECORD_ID") > private Reaction reaction > > PARENT_RECORD_ID is nothing but primary key of parent table. > but while accessing the application i am getting the following exception.... > > MULTIPLE_WRITE_MAPPINGS_FOR_FIELD > > Cause: Multiple writable mappings for the field fieldName are defined in the > descriptor. Exactly one must be defined as writable; the others must be > specified as read-only. When multiple write mappings are defined for the > field, TopLink is unable to choose the appropriate mapping for writing the > value of the field in the database row. Therefore, the exception is raised > during the validation process of descriptors. > > Action: Make one of those mappings read-only > > But i cannot make read only, if i make read only then while inserting new > records it will be problem > > please can anyone provide the solution for this... > Regards, > Saravanan. > > -- > View this message in context: http://www.nabble.com/How-to-map-multiple-properties-to-same-column-as-writable-in-jpa-tf4155235.html#a11822480 > Sent from the OpenJPA Developers mailing list archive at Nabble.com. > > -- Patrick Linskey 202 669 5907