-->
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.  [ 3 posts ] 
Author Message
 Post subject: Appending an entity to the end of bag without loading
PostPosted: Thu Apr 20, 2006 4:23 pm 
Regular
Regular

Joined: Tue May 31, 2005 9:55 am
Posts: 67
Is it true that calling Add on an IList configured as a bag will not load the entire bag? When I try to Add to the end, NHibernate issues a select that loads the entire bag.

I have configured the association like

<bag name="Transactions" lazy="true" batch-size="15" order-by="Id asc" cascade="all-delete-orphan">

Do any of the other attributes have an effect?

thanks,
craig


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 20, 2006 5:28 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
As I understand it, any change to the shape of a bag requires that the entire bag be loaded, or at least have its ids fully loaded. The other collection types do not suffer from this "feature".


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 21, 2006 10:05 am 
Regular
Regular

Joined: Tue May 31, 2005 9:55 am
Posts: 67
I forgot the make the association bi-directional. Once I did, it worked as advertised and it did not need to fetch the entire bag.

craig


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.