The moose likes Object Relational Mapping and the fly likes lazily loading collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "lazily loading collection" Watch "lazily loading collection" New topic

lazily loading collection

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 361
Suppose I have following class,

I load Event from session object. Now when i use getSpeaker(), hibernate would lazily load the speaker collection(assuming lazy is true by default).

I wanted to understand the following concept:

When I do event.getSpeaker(), which give me a set containing Speaker, is the Speaker object populdated with data, or the stubs are loaded initially and then when i make call to Speaker method the object is actually populdated

SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
I agree. Here's the link:
subject: lazily loading collection
It's not a secret anymore!