-->
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: Wht is lazy initializaiton
PostPosted: Mon Apr 10, 2006 5:45 am 
Beginner
Beginner

Joined: Mon Mar 27, 2006 5:25 am
Posts: 39
Location: India Hyderabad
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Wht is the lazy initializaion in hibernate
wht is the use???
How to configure??


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 5:57 am 
Beginner
Beginner

Joined: Wed Apr 05, 2006 3:19 pm
Posts: 43
Imagine you have a group of users. Every user has a set of events to attend.
Code:
User
- Set Events

User
- Set Events

User
- Set Events


If you apply lazy initialization, it means that you can list all the users, without initializing the Events for each user. It would look like this:
Code:
User
- Set events (uninitialized)

User
- Set events (uninitialized)

User
- Set events (uninitialized)


This is used for performance reasons. It is also a logical feature, because you don't need information about the events, if you ask information about the users.

Whenever you want information about the events, hibernate will lazy-load (right on time, when you want it) the events about that user. So imagine you want information about the events of user 1. It will look like this:

Code:
User
- Set events (initialized)
- - Event 1
- - Event 2
- - Event 3
- - .......

User
- Set events (uninitialized)

User
- Set events (uninitialized)


Top
 Profile  
 
 Post subject: lazy initializaion
PostPosted: Mon Apr 10, 2006 6:54 am 
Beginner
Beginner

Joined: Mon Mar 27, 2006 5:25 am
Posts: 39
Location: India Hyderabad
how to configure it


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 7:02 am 
Beginner
Beginner

Joined: Wed Apr 05, 2006 3:19 pm
Posts: 43
Lazy initialization is the default behavior.


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.