Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] JoinColumn ManyToOne set to null on INSERT - circular reference?

I am wondering if the problem has to do with EclipseLink
handling of circular entity references, because essentially 
one user Session entity maintains a collection of FacilitySession 
references which in turn point back to the user Session.

Maybe there are some tricks required to coax EclipseLink to handle that?


On Fri, 3 Jun 2011, doobs wrote:
> Disclaimer: I am not a J2EE developer so I don't have any proper background
> in this
> (so please excuse me when I get the lingo wrong).
> 
> I am trying to migrate an old  (now unsupported) app from Glassfish-2.6 to
> Glassfish-3.0.1 and
> have tried to simply switch the JPA from the old toplink essentials to
> eclipselink 2.0.
> When 2.0 didn't seem to work, I made a switch to 2.2.0, but still have the
> same issue.
> I am building/deploying on Windows XP using NetBeans 6.9.1, and persisting
> to a
> remote Oracle-XE instance.
> 
> Under the original configuration, the App worked fine, but now it doesn't.
> In essence, there are
> 2 entities that need to be persisted to 2 tables of the database and one
> has a foreign key
> reference to the other. Unfortunately, when the persistence takes place, a
> new row is written
> to each table, but the foreign key is set to null.
> 
> 
> The source for the entities is here:
> 
> http://code.google.com/p/icat-dataportal/source/browse/branches/dataminx0/
> coreutil/src/uk/ac/dl/dp/coreutil/entity/Session.java
> 
> http://code.google.com/p/icat-dataportal/source/browse/branches/dataminx0/
> coreutil/src/uk/ac/dl/dp/coreutil/entity/FacilitySession.java
> 


Back to the top