openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: Problem with @ManyToOne and @JoinTable
Date Mon, 05 Nov 2007 19:07:14 GMT
> > What happens if you just use a @OneToOne instead of the @ManyToOne?
>
> The problem is that it's not OneToOne

Can you describe this in more detail? (I.e., in terms of what your
schema looks like.)

-Patrick

On Nov 5, 2007 10:40 AM, Geir Magnusson Jr. <geir@pobox.com> wrote:
>
> On Nov 5, 2007, at 12:44 PM, Patrick Linskey wrote:
>
> >> 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.
>
> We don't have that.  There are reasons, and its intentional.
>
> >
> > What happens if you just use a @OneToOne instead of the @ManyToOne?
>
> The problem is that it's not OneToOne
>
>
> >
> > -Patrick
> >
> > On Nov 5, 2007 9:16 AM, Geir Magnusson Jr. <geir@pobox.com> 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. <geir@pobox.com> 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: <openjpa-1.1.0-SNAPSHOT-r420667:588533 fatal user error>
> >>>> org.apache.openjpa.persistence.ArgumentException: You have supplied
> >>>> columns for "com.joost.model.logistics.InputFile.show<element:class
> >>>> 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
>
>



-- 
Patrick Linskey
202 669 5907

Mime
View raw message