-->
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: Lazy Collection of Proxies X Lazy Collection of Non Proxies
PostPosted: Fri Dec 05, 2003 12:19 pm 
Newbie

Joined: Fri Dec 05, 2003 11:05 am
Posts: 9
Hello,

I would like to know the difference between a
Lazy Collection of Proxies
and a
Lazy Collection of Non Proxies.

If I issue a Hibernate.initilize() in the lazy collection , the elements of the collection will be initialized too, in the case they are proxies ?

Or do I have to iterate over the collectin calling initialize on each element and then causing a database access on each iteration?

Thanks,
Leonardo.

_________________
Leonardo Figueiredo Almeida


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 9:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Hibernate.initialize() is SHALLOW. It does not go any further than the object or collection passed to it.


Top
 Profile  
 
 Post subject: Lazy Collection of Proxies
PostPosted: Tue Dec 09, 2003 9:19 am 
Newbie

Joined: Fri Dec 05, 2003 11:05 am
Posts: 9
gavin wrote:
Hibernate.initialize() is SHALLOW. It does not go any further than the object or collection passed to it.


Ok.

But supose
Code:
myCollection
is a Collection of Proxies.

If I issue a:
Code:
Hibernate.initialize( myCollection );

the proxies are initialized too?

In my tests the proxies were initialized!! It is what I want, but its not what I understood from the doco and from your afirmation...

Is it really the expected behavior?

Thanks again,
Leonardo.

_________________
Leonardo Figueiredo Almeida


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 09, 2003 7:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Could happen if you use a Set, 'cos the underlying HashSet calls equals()/hashCode().


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.