이 콘텐츠는 선택한 언어로 제공되지 않습니다.
15.5. Dynamic association fetching
You can specify association fetching semantics at runtime using
setFetchMode().
List cats = sess.createCriteria(Cat.class)
.add( Restrictions.like("name", "Fritz%") )
.setFetchMode("mate", FetchMode.EAGER)
.setFetchMode("kittens", FetchMode.EAGER)
.list();
This query will fetch both
mate and kittens by outer join. See Section 19.1, “Fetching strategies” for more information.