If you don't want the child queried then you need a second mapping file for
the parent that doesn't have the child as an association. But this has other
consequences, perhaps like inverse=true in the first mapping file on the
association so that updates don't begin conflicting.

John Davidson

On Thu, Mar 18, 2010 at 1:00 PM, Sal <[email protected]> wrote:

> I have a simple one to many association in my model. The parent class
> has a collection of children. In the mapping files, the association is
> a one to many, eager-loaded, using fetchmode.join. This works fine,
> but how can I write a criteria query but NOT trigger the loading of
> the child collection? In other words, I want to query the parent and
> not have it generate the join in the resulting sql. I tried setting
> the fetch mode to lazy, but in that case Nhibernate generates two
> separate queries. I don't want the table for child queried at all.
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

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