You can change the selection strategy (lazy or not) at run time by HQL query or criteria. In HQL, you can use fetch join to initialize the values of a merged collection, for example:
from Cat as cat inner join fetch cat.mate left join fetch cat.kittens
See Hibernate Doku - 15.3. Associations and Associations
Use Criteria.setFetchMode (..) of api criteria instead of querying criteria, for example:
List cats = sess.createCriteria(Cat.class) .add( Restrictions.like("name", "Fritz%") ) .setFetchMode("mate", FetchMode.EAGER) .setFetchMode("kittens", FetchMode.EAGER) .list();
Hibernate Doku for this: 16.5. Dynamic Association Highlighting
source share