jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Pagination of results & position() comparison queries
Date Mon, 12 Feb 2007 15:38:25 GMT
Graeme Rocher wrote:
> I'm trying to figure out how to go about doing some form of pagination
> of query results. In Hibernate app you would likely use the
> setFirstResult and setMaxResults properties to manipulate the result
> set. However, Hibernate handles the various SQL dialect issues around
> data pagination for you.

there is a related enhancement request pending in jira, which does something 
similar: http://issues.apache.org/jira/browse/JCR-679

> I tried the following with an xpath query:
> 
> //wiki:WikiEntry[(position() > 10) and (position() < 20)]
> 
> which I was hoping would return me all the "WikiEntry" items between
> 10 and 20, however it throws this exception:
> 
> javax.jcr.query.InvalidQueryException: Unsupported expression with
> position(). Only = is supported.
> 
> So given that this kind of comparison is not supported with the
> position() function, how would I go about creating the query I'm
> after? Is it possible at all?

for now you should use the skipTo() method on the NodeIterator or the 
RowIterator returned by the QueryResult.

regards
  marcel

Mime
View raw message