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

Joshua Jackson (JIRA) jira-events at lists.jboss.org
Wed Apr 11 22:37:07 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-1055?page=comments#action_12359030 ] 
            
Joshua Jackson commented on JBSEAM-1055:
----------------------------------------

It's true. It adds unnecessary last page that has no record. 

Also there are problems with pagination if it is involved in long running conversation. Have you tried this out?

> 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
>            Priority: Minor
>
> 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