Hi,
I have the following two Entities.
Manager:
Employee:
Now I want to retrieve a manager entity and also want to fectch the employee list eagerly.
My query is like this:
But I am getting the following exception while firing the above query:
Exception in
thread "main" javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: Employees of: bala.persistent.Manager [select m from bala.persistent.Manager m LEFT JOIN FETCH m.Employees where m.id=:mngid]
Can anybody explain why this exception and try to correct it.
And one more doubt is that, how can I retrieve a list of employees for a given manager.
I think of the following query but it is wrong.
But I am getting the following exception for the above query:
Exception in thread "main" javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Path expected for join! [select e from bala.persistent.Employee e JOIN Manager m where m.id=:mngid]
Please explain the above two doubts.
[ August 07, 2008: Message edited by: Christophe Verre ]