These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Enable filters
PostPosted: Wed Oct 24, 2007 3:45 am 
Newbie

Joined: Sun Nov 05, 2006 10:19 am
Posts: 13
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.