java - Pagination with Hibernate Criteria -
i facing problem in pagination. using criteria. display length 10. while clicking pagination shows different results list 9 , 8 that. how avoid kind of pagination problems. need list 10 every time. how control kind of inconsistancy.
user setfirstresult()
, setmaxresults()
this. here short code example:
entitymanager em = ..... .................... typedquery<t> query = em.createquery(criteria); query.setfirstresult(pagenumber * pagesize); query.setmaxresults(pagesize);
Comments
Post a Comment