how to qrite Hql for this scanerio.
I have mapping like this Departments--(1 to many)--Employees---(1 to many)-->Courses
I am looking for a hql query like below
List list = session.createQuery("from where Departments d where d.department_id = 2 and d.employess.employee_id=12 and d.employess.courses.status=1");
In mapping file, I have setup Fetch="join" and batch-size=10. My intention is to load the results in Department object and storing it into a List. Later, i would navigate through Department bean to navigate the associations.
Thanks
Sarab
|