is it possible to create a \'select in\'-query with the hibernate critiria api ?
Example : I have two tables in a 1:n relation, company and department
You can use for this DetachedCriteria
DetachedCriteria subCriteria= DetachedCriteria.forClass(Departament.class);
subCriteria.add(Property.forName("departmentname ").eq("HR"));
subCriteria.add(Property.forName("location ").eq("xyz"));
subCriteria.setProjection(Projections.property("company_id "));
DetachedCriteria criteria = DetachedCriteria.forClass(Company.class);
criteria.add(Property.forName("id").in(subCriteria));