I have an object "Owner" with collection property "Cars". I want to filter Owners based on Cars criteria (Ex: All Owners with Red Cars) and I dont want to query non red cars for SomeOwner.Cars
. So I want one query filter for both parent and collection.
<class name="Owner">
<set name="Cars">
<key column="FK_Owner" />
<one-to-many class="Car" />
</set>
</class>
<class name="Car">
<many-to-one name="Owner" column="FK_Owner" />
</class>
How can I do that?