Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 87072 invoked from network); 5 Nov 2007 17:48:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Nov 2007 17:48:20 -0000 Received: (qmail 5828 invoked by uid 500); 5 Nov 2007 17:44:42 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 5804 invoked by uid 500); 5 Nov 2007 17:44:42 -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 5794 invoked by uid 99); 5 Nov 2007 17:44:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 09:44:42 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of plinskey@gmail.com designates 64.233.170.188 as permitted sender) Received: from [64.233.170.188] (HELO rn-out-0102.google.com) (64.233.170.188) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2007 17:45:14 +0000 Received: by rn-out-0102.google.com with SMTP id e13so544665rng for ; Mon, 05 Nov 2007 09:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; 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; bh=7NVGVkF10WYjylk/jkcUjVxswX0ApR7LNsCkas1tBHY=; b=cQKVSHAmwCuZkHvMA9mfXgtD3EjKdSY90HyCBEO7A0+TNQtY6TA9LlBQpJM8DYG6JB5LMLeYSR/OvLP+RY7oK0R2Ir8QwJ5u3EGxyHB0kE/AQ//1eHPi1ow3o0uOMmandYtk6XZwKhmoZpSbxNYnKXMPJxbzHKEB8sxLtr4jx+w= 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=B6OxFtlGx9e3l4Q+1uI/jktJ1AZW9cpoeFQnC1AAV4EFsdKbphRjwAFwCrPNPGIGZR4HElfSkoYlTLIfBEP5Ftk9Gop9lGes19hbaAF0NrfiLFXYDz1caaBlyOV0fg/L3P92n0xwxJ4yes9co/VVJoXESCrDi5ygJBQ+jj/DUfs= Received: by 10.142.107.1 with SMTP id f1mr296219wfc.1194284664221; Mon, 05 Nov 2007 09:44:24 -0800 (PST) Received: by 10.143.165.19 with HTTP; Mon, 5 Nov 2007 09:44:24 -0800 (PST) Message-ID: <7262f25e0711050944h1b1a005anc2db31dcdbe61e48@mail.gmail.com> Date: Mon, 5 Nov 2007 09:44:24 -0800 From: "Patrick Linskey" To: dev@openjpa.apache.org Subject: Re: Problem with @ManyToOne and @JoinTable In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48D4843F-E9D6-46B2-B88D-E4B44D6D2CF3@pobox.com> <7262f25e0711050848o749e4ddck467146f65e2451c3@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org > I'm a newbie, so I don't quite grok the question. Show itself > doesn't have any references to InputFile. Aha! IIRC, @ManyToOne is only meaningful when used as the back side of a @OneToMany. What happens if you just use a @OneToOne instead of the @ManyToOne? -Patrick On Nov 5, 2007 9:16 AM, Geir Magnusson Jr. wrote: > > On Nov 5, 2007, at 11:48 AM, Patrick Linskey wrote: > > > Hi, > > > > What does the other side of the relation look like? > > I'm a newbie, so I don't quite grok the question. Show itself > doesn't have any references to InputFile. > > > Also, what does > > the Show class look like? > > in what way? Show is a subclass in a JOINED inheritance strategy, if > that makes any difference. > > geir > > > > > > > -Patrick > > > > On Nov 5, 2007 8:08 AM, Geir Magnusson Jr. wrote: > >> I'm a newbie, so forgive me if I'm not asking the question the right > >> way. > >> > >> I have a join table in my DB : > >> > >> +-------------+------------------+------+-----+---------+-------+ > >> | Field | Type | Null | Key | Default | Extra | > >> +-------------+------------------+------+-----+---------+-------+ > >> | showId | int(11) unsigned | NO | PRI | | | > >> | inputFileId | int(11) unsigned | NO | PRI | | | > >> +-------------+------------------+------+-----+---------+-------+ > >> > >> where showId and inputFileID are PKs in the show table and inputfile > >> table. > >> > >> In my code for the InputFile class : > >> > >> @ManyToOne > >> @JoinTable(name="Show2InputFile", > >> joinColumns = @JoinColumn(name="inputFileId"), > >> inverseJoinColumns = @JoinColumn(name="showId")) > >> public Show getShow() { > >> return show; > >> } > >> > >> When JPA is instrumenting my classes, it complains : > >> > >> Caused by: > >> org.apache.openjpa.persistence.ArgumentException: You have supplied > >> columns for "com.joost.model.logistics.InputFile.show >> java.lang.Object>", but this mapping cannot have columns in this > >> context. > >> > >> > >> I don't quite understand the error. I use this same thing elsewhere > >> (I think) w/o a problem. Can someone give me a hint? > >> > >> geir > >> > >> > >> > >> > > > > > > > > -- > > Patrick Linskey > > 202 669 5907 > > -- Patrick Linskey 202 669 5907