Cool Sanjiv. Thanks. The forum shud have more ppl like u. ;) Sam, ----- Original Message ----- From: Sanjiv Jivan To: [email protected] Sent: Monday, June 18, 2007 10:58 PM Subject: Re: [appfuse-user] hibernate pagination question
That seems incorrect. There is a pattern where one gets an extra record only to determine if we're on the last page of data but then return pageSize records to the user, but this doesn't seems to be the case in the wiki article. See http://www.jroller.com/page/sjivan?entry=hibernate_and_oracle_pagination_gotcha for details on the Hibernate pagination pattern. On 6/17/07, j2ee dodo <[EMAIL PROTECTED]> wrote: Hi gang, According to wiki on http://raibledesigns.com/wiki/Wiki.jsp?page=DisplayTagAndHibernatePagination public List getTestData(int page, int pageSize){ Query query = getSession ().createQuery("from Test"); return query.setFirstResult(page * pageSize ).setMaxResults(pageSize+1).list (); } We have pagSize+1 above, but I can't figure out why we really need pageSize+1. So can someone enlighten me on this? Thanks, Sam
