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
