-->
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: hibernate3 filter - how to write a condition with IN
PostPosted: Thu Aug 18, 2005 10:18 am 
Beginner
Beginner

Joined: Tue Apr 12, 2005 9:15 pm
Posts: 24
I want to use hibernate3 filter. I define it like :
<filter-def name="typeFilter">
<filter-param name="myType" type="string"/>
type="boolean"/>
</filter-def>

Then on collection, I want to use this filter to filter the collection for bunch of types. e.g I want the condition as ":myType IN (value1, value2, value3). What would be the syntax of defining such a filter?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 1:03 pm 
Newbie

Joined: Tue Apr 13, 2004 11:34 am
Posts: 4
I believe you have it backwards. :myType will be the value(s) you pass in.

So your condition would be: "column_name in (:myType)"

And you call Filter.setParameterList("myType", values), where "values" is the Collection of values you want in the IN clause.


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.