JPA 2 Criteria Fetch Path Navigation

Agree with you about that method, and the fact that you would expect it to allow what you say. Another option would be

Join<Team, Player> 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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)