I'm having trouble converting the following HQL-query to Criteria API and I was wondering if I could get some help from you guys
SELECT child FROM Foo AS child
WHERE child IN (SELECT elements(obj.foos) FROM Bar AS obj WHERE obj.id = ?)
In other words, I want to fetch all Foos that Bar references to in the instance of Bar whose id is equal to ?.
Edit: Note that I don't have a two-way-relation between the entities, so Foo doesn't know which Bars have a reference to it. Secondly, the reference from Bar to Foo is of type ManyToMany.