jpa lazy fetch entities over multiple levels with criteria api
It does not work with JPQL and there is no way to make it work in CriteriaQueries either. Specification limits fetched entities to the ones in that are referenced directly from the returned entity:
About fetch join with CriteriaQuery:
An association or attribute referenced by the fetch method must be referenced from an entity or embeddable that is returned as the result of the query.
About fetch join in JPQL:
The association referenced by the right side of the FETCH JOIN clause must be an association or ele ment collection that is referenced from an entity or embeddable that is returned as a result of the query.
Same limitation is also told in OpenJPA documentation.