You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by hsp_ <pi...@ibest.com.br> on 2008/01/23 12:19:23 UTC

Get a portion of the result set.

I would to know if is there in jackrabbit a way in get the result set of a
query like (from 1 to 20).
In version 1.4 there is the count() function, but if I am get the pages of
result set with 20 records each, how to do this in jackrabbit, is there some
funcionality I could use for this?
Thanks
Helio.
-- 
View this message in context: http://www.nabble.com/Get-a-portion-of-the-result-set.-tp15039590p15039590.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


RE: Get a portion of the result set.

Posted by Ard Schrijvers <a....@hippo.nl>.
Hello,
> 
> I would to know if is there in jackrabbit a way in get the 
> result set of a query like (from 1 to 20).

use something like 

Query q = superuser.getWorkspace().getQueryManager().createQuery("//*",
Query.XPATH);
        if (q instanceof QueryImpl) {
            // limit the result set
            ((QueryImpl) q).setLimit(x);
            ((QueryImpl) q).setOffset(y);
        }

-Ard

> In version 1.4 there is the count() function, but if I am get 
> the pages of result set with 20 records each, how to do this 
> in jackrabbit, is there some funcionality I could use for this?
> Thanks
> Helio.
> --
> View this message in context: 
> http://www.nabble.com/Get-a-portion-of-the-result-set.-tp15039
> 590p15039590.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
> 
>