jpa - JPQL LEFT JOIN: is the collection member variable condition evaluated against all members? -
suppose have jpql query this:
select p parent p left outer join p.children child p.children empty or child.x = 'y'
i parent
instances returned in of following cases:
- the
parent
has no children - the
parent
has @ least 1 childx
equaly
according jpa specification, should query above want? or must drag out exists
-and-subquery-and-in
machinery?
yes, query want, no matter jpa implementation. don't see room doubt, although can feel don't like: table children
joined twice. in imho jpa implementation should make 2 db queries if needed in order return correct data.
Comments
Post a Comment