[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3750) Allow dialects to handle difference in how Query.setFirstResult() should be interpreted

Steve Ebersole (JIRA) noreply at atlassian.com
Tue Feb 3 10:42:38 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32287#action_32287 ] 

Steve Ebersole commented on HHH-3750:
-------------------------------------

I am thinking along the lines of adding a method to Dialect like:

/**
 * Hibernate APIs explcitly state that setFirstResult() should be a zero-based number.  Here we allow the
 * Dialect a chance to convbert that value based on what the underlying db or driver will expect.
 * 
 * @param zeroBasedFirstResult The user-supplied, zero-based first row offset.
 * 
 * @return The corresponding db/dialect specific offset.
 *
 * @see org.hibernate.Query#setFirstResult
 * @see org.hibernate.Criteria#setFirstResult
 */ 
public int convertToFirstRowLimit(int zeroBasedFirstResult) {
    return zeroBasedFirstResult;
}

> Allow dialects to handle difference in how Query.setFirstResult() should be interpreted
> ---------------------------------------------------------------------------------------
>
>                 Key: HHH-3750
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3750
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: core
>            Reporter: Steve Ebersole
>            Assignee: Steve Ebersole
>
> Specifically, it appears that some databases will interpret the number we bind as 0-based, while others interpret it as 1-based.  We should allow Dialects to handle this difference.

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

        



More information about the hibernate-issues mailing list