First of all, thank you for promptly implementing JOIN FETCH over nested paths in response to my inquiry a few months ago.
However, I have run into one problem: if an embedded collection is empty, but I attempt to LEFT JOIN FETCH all the members of a collection within a (non-existent) member of the first collection, the result of the overall query is an empty set.
To use the example from my original post:
@Embeddable class A { String val; };
@Embeddable class B { List<A> aList; };
@Entity class C { @Id long id; List<B> bList; };
If I have an instance of C where bList is empty, the following works (returns my instance of C):
SELECT c FROM C c LEFT JOIN FETCH c.bList WHERE id=:id;
But if I include the full nested fetch, it fails, returning an empty result list:
SELECT c FROM C c LEFT JOIN FETCH c.bList LEFT JOIN FETCH c.bList.val WHERE id=:id;
The semantics implied by LEFT JOIN suggest that in the case of this instance of C, the two should both return the same value.
I've checked my server, and there are no errors logged for this.