Hi,

I got a parent mapping like this (http://pastie.org/3091773)


    <id name="Id">
      <column name="ID" length="36" />
      <generator class="assigned" />
    </id>
    <bag cascade="none" inverse="true" lazy="false" name="Child1">
      <key>
        <column name="PARENT_FK" />
      </key>
      <one-to-many class="Child1" />
    </bag>
    <bag cascade="none" inverse="false" lazy="false" name="Child2">
      <key>
        <column name="PARENT_FK" />
      </key>
      <one-to-many class="Child2" />
    </bag>

When I try to load the parent, session.Get(parentId), NHibernate will
generate 3 queries, one for the parent, and another one for each child.
Thats the expected way to work?

I dont want lazy-loading, since some people can mess up with N+1 selects,
but also I wanna be able to query a parent with all childs, when necessary
(so I need this mapping).
Theres any other way to solve this ?

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