-->
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: what is lazy loading
PostPosted: Tue Aug 21, 2007 3:07 am 
Newbie

Joined: Thu Feb 01, 2007 1:57 am
Posts: 17
Location: Mumbai
Hi friends,

plz help me concept of lazy loading and batch loading with an example.


Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 5:36 am 
Senior
Senior

Joined: Thu May 17, 2007 2:31 am
Posts: 194
Location: Sri Lanka
Hi

let say Class A has a set of Class B objects (one-to-many) . in our mapping file A.hbm.xml we can map that assosiation witha Set element. When we retirve a Class A object by session.get() or sessiong.find() etc. we will have A objects with set of B objects.

Say we don't want set of B's at some given time so we want to fetch only data related to A. (not B data) . So we have to mention it to hibernate. here comes lazy loading. We can say in our mapping file Set of B's must lazyly load. It means it will actually fetch at the time we use it. Otherwise it send a Set (not null) of proxies objects.

This is the rough idea for lazy loading.


Amila
(Don't forget to rate ig helps)


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.