-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate filter: always-on, static expression
PostPosted: Wed Jul 04, 2007 3:07 am 
Newbie

Joined: Mon Jun 11, 2007 5:45 am
Posts: 8
I have a problem getting my head around this:

By default, I need a filter on my data, where a specific column can not have 'BA' as value.

I used the following filter in my class-def

Code:
<filter name="NoBaDocuments" condition="DOC_CDE != 'BA'"/>


And the following filter-def:
Code:
<filter-def name="NoBaDocuments" />


Unfortunately, this doesn't do anything, because (I think) I need to enable the filter on a Session level.

Am I using a completely wrong approach and is there another solution, or am I just missing something here?



Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 3:49 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You should use where attribute in this case (<class where="...">), or call EnableFilter on every ISession you create.


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

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.