you should use a collection loader in the mapping instead CreateSQLQuery.
btw what you want do is possible
http://fabiomaulo.blogspot.com/2009/03/ensuring-updates-on-flush.html
<http://fabiomaulo.blogspot.com/2009/03/ensuring-updates-on-flush.html>The
actualized implementation is available in uNhAddIns.

2009/10/29 Jon Kruger <[email protected]>

>
> I have a situation where I need to load part of an object graph using
> custom SQL (for performance reasons). So I load up this collection
> using my custom SQL (ISession.CreateSQLQuery()) and then I assign that
> list to a property on another entity object.
>
> The problem is that when I assign the list to the property, it makes
> that entity dirty along with all of the objects in the list, so when I
> go to save the object, it does hundreds of queries to save the entire
> list. Is there a way that I can specify that an object is NOT dirty
> (after I load it up myself)?
>
> (Yeah, I know I could turn off cascade="save-update", but I really
> don't want to have to do that if I can avoid it.)
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
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