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.  [ 1 post ] 
Author Message
 Post subject: Adding to lazy-loaded collection without loading it
PostPosted: Mon Oct 26, 2009 4:59 pm 
Newbie

Joined: Mon Oct 26, 2009 4:53 pm
Posts: 2
I would like to know whether the following is possible.

I have a collection of objects that I am persisting via NHibernate. The list contains "archive" or "history" records for a given object. We might create a new "archive" record, and add it to this list, at any time during the life of the object. However, by default, the first time I add a new "archive" to the collection after loading the object, it will trigger a lazy-load of every "archive" currently persisted for that object. I really don't want to have to load all archives from the database, and into memory, just to create an archive record.

Ideally, I would be able to create an archive record, add it to the collection (without populating the collection with the database-stored entries), and persist it without ever loading the existing archives.

Is there some mechanism that makes this possible?

Thanks,

-Dan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.