If we have for example these entities:
HQL like this: select a.id from A a where exists (select b.id from B b where a.b.c.id = 5) will produce SQL: select a1_0.id from A a1_0 where exists(select b1_0.id from B b1_0,B b2_0 where b2_0.c_id=5) This is obviously wrong as b2_0 should be in correlation with a1_0 . Exists is not a factor here as this does not work with in either. Attached test contains more examples, see console output. |