jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Sascha.The...@bosch-si.com>
Subject AW: How do I get the total size of nodes/rows from a QueryResult
Date Tue, 25 Oct 2011 16:06:37 GMT
> 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:a.schrijvers@onehippo.com] 
Gesendet: Dienstag, 25. Oktober 2011 17:38
An: users@jackrabbit.apache.org
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 <jukka.zitting@gmail.com> wrote:
> Hi,
>
> On Tue, Oct 25, 2011 at 4:25 PM,  <Sascha.Theves@bosch-si.com> 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

Mime
View raw message