Given the following JPQL query:
Select p, child, subChild
from Entity parent p
left join Child parent.children child
left join SubChid child.subChildren subChild on subChild.field = 'value'
I expect to have the parent entity with only child which have subChild with field = 'value' and I also expect to have the child.subChildren filtered to only return the one matching the 'on' clause. I am wondering if this is allowed by JPA 2.1. This seems to be but I tried with eclipselink 2.5.3 and it doesn't work as expected.
The SQL query generated is correct. It returns only the expected rows but the parent entity is not filtered and is returned with the complete object graph which I don't understand.
Can someone give me some inside on how to solve that issue?