//Oracle最优化分页查询语句:select * from( select row_.*, rownum rownum_ from( select* from TEST0816.T_USER user0_ orderby user0_.USER_ID ) row_ where rownum <= ? ) where rownum_ > ?//eg:public void test6() { //设置开始行号——(页码-1)*每页行数 //使用方法链查询 Listlu =se.createQuery("from User order by userID") .setMaxResults(5) .setFirstResult(5) .list(); //遍历 for(User u:lu) { System.out.println(u); } }