I m having real difficulty getting the eclipselink.join-fetch hint to work in glassfish.
I have a Client object that contains a collection of Task objects and the Task object has a collection of WorkPeriod objects.
My code looks like this:
Query query = entityManager.createQuery("select client from Client client left join fetch client.tasks");
//Set hint to allow nested fetch joins
query.setHint("eclipselink.join-fetch","client.tasks.workPeriods");
List<Client> clients = query.getResultList();
But no matter what I do when I set the TOPLINK debug level to fine it always shows that the SQL which is actually run is:
SELECT t0.ID, t0.NAME, t1.ID, t1.DESCRIPTION FROM CLIENT t0 LEFT OUTER JOIN (CLIENT_TASK t2 JOIN TASK t1 ON (t1.ID = t2.tasks_ID)) ON (t2.Client_ID = t0.ID)
Clearly not doing the third tier of the join fetch.
有没有其他人也遇到这个问题...还是只有我呢 :-(
任何帮助或提示(无任何恶意)将不胜感激。