Hi,
I have two tables in one - to - many relation. Users & Employees.
The employee table has a column called isActive.
In the Users.hbm.xml file I have
Code:
<class name="Namespace.User, Namespace" table="Users">
.................
<bag name="ActiveEmployees" lazy="true" cascade="all">
<key column="ownerId"/>
<one-to-many class="Namespace.Employee, Namespace"/>
<filter name="ActiveEmployees" condition="isActive = 1"/>
</bag>
</class>
Everything works ok if I enable the filter when I open the session. My problem is that I have this kind of filters in many places, so I would prefer to enable the filter from configuration or from only one shoot? Is there any way to do this?
The reason is that in Users.cs I have a property ActiveEmployees which I want to access the filter without telling it to do that.
Thank you!