Re: Mapping a collection of entities...

2008-11-18 Thread cobbra
Perfect! Many thanks. Setting UserProperties as the owner and removing the @JoinColumn from both entities did the trick! Looks like I need more study, or just more patience while I "try" to get things right. Thank you! Randy Wes Wannemacher <[EMAIL PROTECTED]> wrote: > My understanding

Re: Mapping a collection of entities...

2008-11-18 Thread Wes Wannemacher
My understanding is that you choose one of the two sides as "owning" the relationship. Let's assume that we want the @ManyToOne side as the owner. In that case, you'll map the @ManyToOne as follows - @ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.PERSIST) private UserInfo userInfo; And

Re: Mapping a collection of entities...

2008-11-18 Thread cobbra
Same result. I'm running in Geronimo 2.1.3 which IIRC comes with OpenJPA 1.0.2. As such, I couldn't use the syntax you suggested, so I used the one that compiles. The javax.persistence library with 1.0.2 says "mappedBy" wasn't found... so I used this syntax in UserProperties: @ManyTo

Re: Mapping a collection of entities...

2008-11-18 Thread cobbra
Thanks for the quick reply. I'll give that a shot. Wes Wannemacher <[EMAIL PROTECTED]> wrote: > > On Tue, 2008-11-18 at 19:36 -0600, [EMAIL PROTECTED] wrote: > > Hello all, > > > > I'm trying to teach myself OpenJPA and failing miserably... > > I have two entities (code below) where one

Re: Mapping a collection of entities...

2008-11-18 Thread Wes Wannemacher
On Tue, 2008-11-18 at 19:36 -0600, [EMAIL PROTECTED] wrote: > Hello all, > > I'm trying to teach myself OpenJPA and failing miserably... > I have two entities (code below) where one contains a collection > of the other. The intent is for UserInfo to be able to contain > a collection (or List