ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "meindert" <meind...@eduflex.com>
Subject skip Results, maxResults in statement
Date Fri, 16 Oct 2009 13:59:37 GMT
Hi All,


I want to use pagination as efficient as possible. Mike Haller posted a nice
blog about it;



The problem is that I want to do the paging on the statement level, I know
that that would limit the query to one database (sql Server 2005 in my case)

But is there a way to get the values of the skipResults, maxResults
parameters in the statement?


At the moment i add a paging object to my POJO class, example;

<isNotNull property="paging.endRow"> top $paging.endRow$ ROW_NUMBER() OVER(

            Order by <isNull property="paging.sortBy">[default sorting
column] DESC</isNull> 

                       <isNotNull property="paging.sortBy">$sortBy$
$sortorder$</isNotNull>) as Row,



    [The normal query]


    <isNotNull property="paging.endRow"> WHERE  Row >= #paging.startRow# AND
Row &lt;= #paging.endRow# </isNotNull> 

      ORDER BY <isNull property="paging.sortBy">[default sorting column]

                   <isNotNull property="paging.sortBy">$paging.sortBy$




Meindert Hoving


View raw message