-->
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: Lazy fetching may be completely disabled by setting lazy...
PostPosted: Thu Mar 30, 2006 4:27 am 
Newbie

Joined: Wed Mar 29, 2006 2:10 am
Posts: 3
In the Hibernate documentation, it states that:

Lazy fetching may be completely disabled by setting lazy="false"

But what does this mean, exactly?

I have a mapping document with a class element that has lazy="false" and two one-to-many associations, yet if I load an instance of the class with:

Session.load(Class, Serializeable)

it doesn't load the other associations or collections.

So, in what sense has lazy fetching been disabled?

In other words, under what circumstances should I expect to see different behaviour between lazy="false" and lazy="true" when specified on a Hibernate "class" element?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 1:18 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Might it have something to do with access="field"? If you've set your default access type to field, setting class lazy="false" would cause all fields in the class to be fetched when any field was accessed.

Alternatively, it might refer to references to this class, rather than from it. The default lazy value on most associations is false: if you do something like <many-to-one class="ClassWithLazyFalse"/>, is it eagerly loaded?


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.