With JPA 2 Criteria Join method I can do the following:
//Join Example (default inner join)
int age = 25;
CriteriaBuilder cb = entityManager.getC
Agree with you about that method, and the fact that you would expect it to allow what you say. Another option would be
Join p = t.join(Team_.players);
t.fetch(Team_.players);
c.select(t).where(cb.equal(p.get(Player_.age), age));
i.e do a join()
, add a fetch()
for it, and then make use of the join. This is illogical and only adds to the inelegant nature of JPA Criteria, but anyway, ought to be a workaround