Re: inverse OneToMany relation - getting weird

2009-11-14 Thread Daryl Stultz
On Sat, Nov 14, 2009 at 4:16 PM, Michael Dick wrote: > If I understand the problem correctly the issue exists whether you have a > L2 > cache or not.. Consider the Father -> Child One -> Many relationship. > > If you do something like this : > > Child c = em.find(Child.class, 123); > Father oldFat

Re: inverse OneToMany relation - getting weird

2009-11-14 Thread Michael Dick
On Sat, Nov 14, 2009 at 2:41 AM, Marc Logemann wrote: > Hi, > > thanks for your infos on that. I will stick with setting the backrefs > manually as you did it and keep chosing the @ManyToOne on the child. What > strikes me even more is that you can just do that: > > public class Team { > >...

Re: inverse OneToMany relation - getting weird

2009-11-14 Thread Michael Dick
On Fri, Nov 13, 2009 at 12:50 PM, Daryl Stultz wrote: > On Fri, Nov 13, 2009 at 1:09 PM, Michael Dick >wrote: > > > The real issue is setting the backrefs. In JPA the application must > > maintain > > both sides of a bi-directional relationship (on your Java objects). > There's > > some wording

Re: Detached entities, version attribute and optimistic concurrency control

2009-11-14 Thread Marc Logemann
Hi, i dont get why you manually want to modify the JPAVERSION attribute. If you dont want to keep the detached object in the session (thats what we do), you must at least remember the OID (object id) of the Document, find it again from the persistenceManager and then do the changes on the o

Re: inverse OneToMany relation - getting weird

2009-11-14 Thread Marc Logemann
Hi, thanks for your infos on that. I will stick with setting the backrefs manually as you did it and keep chosing the @ManyToOne on the child. What strikes me even more is that you can just do that: public class Team { ... @OneToMany(cascade = CascadeType.PERSIST, mappedBy = "team

Detached entities, version attribute and optimistic concurrency control

2009-11-14 Thread Nikhil Patwardhan
Hi, I'm new to OpenJPA and I have been trying to create a small prototype demonstrating how I can use it as a JPA compliant persistence provider in a J2EE web applications. In one of my use cases, I do the following: 1) Look up an entity(Class name:Document, for instance) using em.find() in the