jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: NodeIterator.getSize() returns -1 for query with order by clause
Date Tue, 27 Apr 2010 12:21:27 GMT
On Tue, Apr 27, 2010 at 10:13, Gadbury <gadbury@googlemail.com> wrote:
> Supplying an order by constraint does not always solve the problem of
> node/rowIterator.getSize() returning -1.
>
>
>                select * from [my:order] as orders
>                where orders.[orderStatus] = 2
>                order by orders.[jcr:created] asc
>
> The above query returns the correct amount of nodes BUT
> nodeIterator.getSize() returns -1.
>
>
>
>                select * from [my:order] as orders
>                order by orders.[jcr:created] asc
>
> The above query returns the correct amount of nodes AND
> nodeIterator.getSize() returns the correct value.
>
> So there are cases when supplying order by DOES NOT force a count.

The above queries seem to be JCR-SQL2 queries, because of the "AS"
usage. As I almost expected, that implementation, which is a bit
different from xpath/jcr-sql, doesn't seem to work with the order by
trick.

Regards,
Alex

Mime
View raw message