Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » hibernate gotchas
hibernate gotchas [message #715979] Tue, 16 August 2011 06:43 Go to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 817
Registered: July 2009
Senior Member
I found this in a hibernate gotcha article and was wondering if the same applies to EclipseLink:

When mapping a relation as One-to-One or Many-to-One on the "One" side of the relation you can't have lazy loading unless you specify the field as not nullable.

Why is that?
Essentially on the many side of the relation hibernate can use collection proxies and lazily load instances when required.
On the "One" side there is no collection interface but instead a reference to one of your model classes.
Hibernate can proxy that one as well but only if it is sure the reference will never be null!

Re: hibernate gotchas [message #716095 is a reply to message #715979] Tue, 16 August 2011 12:54 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1382
Registered: July 2009
Senior Member
That is a Hibernate specific limitation.

EclipseLink uses weaving (static or dynamic) to allow lazy relationships, so they can be nullable, as described here:

Best Regards,
Previous Topic:(no subject)
Next Topic:Howto log SQL with java.util.logging?
Goto Forum:

Current Time: Mon Apr 12 22:59:02 GMT 2021

Powered by FUDForum. Page generated in 0.01920 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top