I have a mapping for a persistent object that specifies that one of its collections should be outer joined so that all of the data was queried at once.
Here is an excerpt form the mapping file:
Code:
<class name="HttpMenuItem" table="MenuItem" mutable="false" >
<!--ID-->
<id name="Id" type="System.Int32" column="MenuItemId" unsaved-value="0" access="field.camelcase-underscore">
<generator class="identity" />
</id>
<!--PROPERTIES-->
<property name="Name" column="Name" length="50" not-null="true" access="field.camelcase-underscore"/>
<!--COLLECTIONS-->
<list name="NavigateUrls" table="MenuItemUrl" lazy="false" access="field.camelcase-underscore" outer-join="true" batch-size="10">
<cache usage="read-only" />
<key column="MenuItemId" />
<index column="Sequence" />
<element type="System.String" column="Url" not-null="true" length="255" unique="true" />
</list>
</class>
When querying with the ICriteria interface, I was under the impression that NHibernate would flatten the resultset. This is not occuring. I am getting duplicates of the same object in my resultset depending on how many NavigatUrls each menu item has. As soon as I set outer-join="false" on the NavigateUrls collection, everything works as planned.
Is this a bug?