How to express such HQL query via criteria API?
select a from A a where
(select b.prop from B b where b.id = a.parent) in ('1', '2', '3')
List of ids is passed as parameter.
Here is my subquery:
DetachedCriteria subQuery = DetachedCriteria.forClass(B.class, "b").
.add(Restrictions.eqProperty("b.id", "a.parent"))
.setProjection(Projections.property("b.prop"));
Subqueries.in and propertyIn work the opposite way (prop in subquery, not subquery in prop as i need). Any thoughts?