If I apply a "where" attribute on a class mapping, then I notice that it is applied when retrieivng an instance of that entity using session.Load().
Code:
<class
name="Foo"
table="Foo"
where="FooType = 1"
lazy="false">
<id name="FooId">
<generator class="identity" />
</id>
<property name="FooName" />
</class>
However, if that class is linked to another class as a many-to-one, then the "where" is completely ignored when the containing class is loaded.
Code:
<bag name="FooItems" lazy="false">
<key column="FooId" />
<one-to-many class="Foo" />
</bag>
Is this by design?