How can I use the Criteria class to create a query like this.
Code:
select * from cats, kittens left join kittens.parent_id on cat.id where (cat.name="Pussy" or kitten.name="Kitten")
I have not tested the query above but you should/could maybe understand what I'm trying to do.
In Hibernate I can do the following.
Code:
criteria.createCriteria("cat").add(Expression.eq("name", "Pussy"));
criteria.createCriteria("kittens").add(Expression.eq("name", "Kitten"));
But I cannot figure out how to get the OR into the query. Since Expression.conjunction does not take a Criteria as an argument.