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();