-->
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.  [ 4 posts ] 
Author Message
 Post subject: one-to-one with lazy initialization
PostPosted: Tue Oct 21, 2003 6:08 am 
Newbie

Joined: Tue Oct 07, 2003 6:48 am
Posts: 10
Hi!

I have a bidirectional one-to-one relation between two classes.

Id like to make this relation lazy, because I dont want to load second class until I call getClass() method in the first class.


Can I do that?
If answer is yes, how?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 21, 2003 12:39 pm 
Regular
Regular

Joined: Tue Sep 16, 2003 11:35 am
Posts: 93
Location: San Francisco, CA
I'm pretty sure you can't do this. You can however, use an automatic lazy object proxy for the class that you want to load lazily. I think it describes this in the doc.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 22, 2003 4:42 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Proxy the one-to-one "child".
<class name="ChildOneToOneClass" proxy="ProxyInterface">
See 4.1.3 of hibernate ref guide

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 22, 2003 5:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
note that this only works for the direction marked constrained="true". Otherwise we have to hit the database to determine if the object is null.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.