ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Biondi" <Ste...@schemalogic.com>
Subject RE: Question about paginated list.
Date Fri, 30 Sep 2005 03:53:48 GMT
Which DB are you using? For example, in Oracle something like this works:
select *
  from ( select a.*, rownum rnum
           from ( YOUR_QUERY_GOES_HERE -- including the order by ) a
          where rownum <= MAX_ROWNUM )
 where rnum >= MIN_ROWNUM
The nice thing about this technique is you can page just about anything with it. Similar stuff
in DB2.
Given this approach, I'd love to hear how people have modularized this using iBatis to support
"page mode" for any query. Hadn't thought about that much.


From: anton [mailto:antonkurniadi@indoartha.co.id]
Sent: Thu 2005-09-29 7:27 PM
To: user-java@ibatis.apache.org
Subject: Question about paginated list.


Recently im working with paging feature in my web application, and I need to get a ranged
results from a query, lets say that my query will get 10.000 records but I want to get only
10 records from it,(eg starting from record 9.980 until record 9.990), I already know iBATIS
paginated list but it doesn't solve my problem since the queryForPaginatedList() method retrieve
all the 10.000 records. Does anyone here know how can I achieve that (Hibernate already come
with the Query.setFirstResult() and Query.setMaxResult() method to solve this)? Thank You.



View raw message