-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Best practise wanted: lazy and nullable ToOne-Association
PostPosted: Mon Apr 07, 2008 8:58 am 
Beginner
Beginner

Joined: Wed Nov 21, 2007 8:04 am
Posts: 27
I gather hibernate can not load the endpoint of a nullable ToOne-Association lazily [1]. What is the preferred way to work around this limitation?

I am thinking of using a ToMany-Association instead, and encapsulate the set with single-valued @Transient accessors. Of course, this is rather ugly as people writing queries still have to be aware of the set, and have to use other property names than the public API exposes. Is there a better way?

---

[1] Because for To-One-Associations, the property is lazily loaded by installing a lazy loading proxy that pretends to be the entity, and no proxy can pretend to be null. See also http://forum.hibernate.org/viewtopic.php?t=929127 and http://www.hibernate.org/162.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 5:41 am 
Beginner
Beginner

Joined: Wed Nov 21, 2007 8:04 am
Posts: 27
What do I have to do to get an answer?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.