Hi,
Hibernate version:
hibernate-3.2.5.ga
Name and version of the database you are using:
Oracle 10g
We have a requirement where we need to get some specified number of records of main entity. The main entity has two one-to-many associations.
I have this criteria query:
Code:
Criteria cr = this.session.createCriteria(this.persistentClass).setFetchMode("asscoiation1", FetchMode.JOIN).setFetchMode("asscoiation2", FetchMode.JOIN).setFirstResult(0).setMaxResults(20);
List rows = cr.list();
Ideally I want above criteria to generate the query in such away that it fetches 20 main entities along with all their associations. The actual result set may be more than 20.
Can you please help me to modify the above criteria query so that it returns 20 main entities along with all their associations?
Thanks
Kamesh