I'm working with hibernate and I'm having troubles creating an hql query that fetches all the children of my object.
For example: The Object User has a list of Cars and a list of Friends.
To get a user with his cars I would use following query:
from User u left join fetch u.cars where u.id = ?
This works fine, so I thought it would be easy to get a user with his cars and with his friends with following query:
from User u left join fetch u.cars left join fetch u.friends where u.id = ?
But this gives me following error:
HibernateException: cannot simultaneously fetch multiple bags
Now my question is: what is the right way to fetch multiple children in hibernate?