You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Christian Ehmig <ch...@gmx.de> on 2003/04/26 19:50:55 UTC

Using the Methods setStartAtIndex & SetEndAtIndex in Class Query

I am using PB API and trying to "imitate" a SELECT * FROM * LIMIT x,y.
While browsing through the JavaDoc for the Class Query I found the following two methods:

  setStartAtIndex(int arg) 
  (comment: Set the row at which the query should start retrieving results, inclusive.)

  setEndAtIndex(int arg)
  (comment: Set the row at which the query should stop retieving results, exlusive.)

I tried to use them but they seem to do really nothing.

Code excerpt:
Query query = new QueryByCriteria(Foo.class, null);

query.setStartAtIndex(10);

query.setEndAtIndex(25);



Does anybody know a solution or even a workaround? I desperately need this for paging results.

Thanks a lot,

Christian