Dynamic association fetching by R4R Team

We can specify association fetching semantics at runtime using setFetchMode(). as given below:


List student = session.createCriteria(Student.class)

    .add( Restrictions.like("name", "Gourav%") )

    .setFetchMode("mate", FetchMode.EAGER)

    .setFetchMode("poraskar", FetchMode.EAGER)

    .list();


By the help of This query will fetch both mate and kittens by outer join. 

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!