Pagination in Hibernate by R4R Team

When we need to specify bounds upon your result set, then we can that is, the maximum number of rows to retrieve and/or the first row which we want to retrieve, Hibernate knows how to translate this limit query into the native SQL of out DBMS. so we can use the below given methods of the Query interface:

Query q = sess.createQuery("from DomesticStudent student");
q.setFirstResult(20);
q.setMaxResults(10);
List cats = q.list();
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!