[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-1055) Query Pagination in JBoss Seam Framework

Gavin King (JIRA) jira-events at lists.jboss.org
Mon May 21 13:33:52 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-1055?page=all ]

Gavin King closed JBSEAM-1055.
------------------------------

    Fix Version/s: 1.3.0.BETA1
       Resolution: Done
         Assignee: Gavin King

Thanks, the bug should now be fixed in CVS, please test my fix, TIA.

> Query Pagination in JBoss Seam Framework
> ----------------------------------------
>
>                 Key: JBSEAM-1055
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1055
>             Project: JBoss Seam
>          Issue Type: Patch
>          Components: Framework
>    Affects Versions: 1.2.0.GA
>            Reporter: Antonio Navas
>         Assigned To: Gavin King
>            Priority: Minor
>             Fix For: 1.3.0.BETA1
>
>
> I'm not sure that this is the correct procedure, but I want to contribute to this project....
> I think there is an issue regarding pagination in EntityQuery. The problem is that it adds an unnecessary last page when the actual size of the result list equals the maxResults attribute. For example, if maxResults is set to 5 and the total result count for the query is 10, the pagination returns 3 pages instead of 2, and the last page is empty. I think that the implementation of the methods "isNextExists" and "getLastFirstResult" are wrong, and the correct implementation should be:
> 	public boolean isNextExists() {
> 		return getResultCount() > (getFirstResult() == null ? 0 : getFirstResult()) + getMaxResults();
> 	}
> 	public long getLastFirstResult() {
> 		return ( (getResultCount()-1) / getMaxResults() ) * getMaxResults();
> 	}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list