Hi hibernate users!
I am developing a multi-criteria search page (somethign like
http://www.devx.com/Java/Article/28754/ ... portItem=1), and I use Hibernate's org.hibernate.Criteria class to construct the filtration. Now I need to do something like this:
SELECT * FROM table1 JOIN table2 ON table1.col1=table2.col2
WHERE table2.colA='abc'
AND 'abc' IN (
SELECT col3 FROM table3 WHERE ....
)
Note that at the 'IN' clause, I use a string value (abc) instead of a table field.
Now, Hibernate provides this:
org.hibernate.criterion.Property.in(Collection values)
But the problem is, this method in() can only be called from the Property class (which represents a table field). But I don't want to filter any field by using the IN operator. I just want to make sure that the string value (abc) exists in table3.
Is it possible to do this using Hibernate's Criteria API?
Hope you would help.
Thank you!
Best Regards
Will Sumekar