> Use the getSize() method of the returned node or row iterator. I think that returns the size of elements in the iterator and that is hopefully not the complete size if I used the limit and offset options...
I used an XPath query before switching to jackrabbit 2.2.9 but I thought I should change my query to SQL2 because xpath is deprecated now. And just regarding the JCR 2.0 API I am very not sure why can I now set the limit and offset for a query but I do not have the possibility to retrieve the total size of elements. That doesn`t make any sense to me because the one doesn`t make sense without the other in my opinion. So what is your recommendation now? Should I switch to SQL2? What about the total size then? Or should I still use xpath? I am currently switching because it seems that my xpath queries do not work any longer. A lot of tests do fail now... I have to track this down but it seems that I run into another backward incompatibility issue here... -----Ursprüngliche Nachricht----- Von: Ard Schrijvers [mailto:[email protected]] Gesendet: Dienstag, 25. Oktober 2011 17:38 An: [email protected] Betreff: Re: How do I get the total size of nodes/rows from a QueryResult On Tue, Oct 25, 2011 at 5:02 PM, Jukka Zitting <[email protected]> wrote: > Hi, > > On Tue, Oct 25, 2011 at 4:25 PM, <[email protected]> wrote: >> How do I get the total size of nodes or rows with Jackrabbit 2.2.9? > > Use the getSize() method of the returned node or row iterator. Wasn't a problem that if you do not use an order by clause and you did not iterate yet over the result set, that you get -1 ... I thought I saw something like that before. Regards Ard > > BR, > > Jukka Zitting > -- Amsterdam - Oosteinde 11, 1017 WT Amsterdam Boston - 1 Broadway, Cambridge, MA 02142 US +1 877 414 4776 (toll free) Europe +31(0)20 522 4466 www.onehippo.com
