I'm trying to implement some of the ideas of Udi Dahan in his blog
post "Don't create aggregate roots" (http://www.udidahan.com/
2009/06/29/dont-create-aggregate-roots/) using NHibernate.

In a nutshell, the idea is to avoid explicit persistence code. When
one wants to save a new object, instead of doing a session.Save(...),
one loads another object and adds the new object to a collection on
the existing object. The idea is that the ORM will persist the new
object automatically. Think of adding an order - just load the user
and add the new order to the user's Orders collection. It's a very
elegant idea, but...

It works fine with NHibernate, but the problem is that when the new
object is added to the collection, this triggers NHibernate to load
ALL the items in the collection.

Is there a way where one can add an item to a proxied collection in
NHibernate *without* it loading all the other entries, so that only
the new item will be persisted to the database?

Would it require a special collection proxy?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to