jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodrigo Meza <rodrigo.meza.fo...@gmail.com>
Subject number of results in a query?
Date Fri, 19 Mar 2010 19:50:53 GMT
Hello,
  I am not sure if this is the right list to make my question, but I
didn't find a jcr-2 list. My problem is that queries in jackrabbit
sometimes return -1:



int n = queryManager.createQuery("SELECT * from [my:nodetype]",
Query.JCR_SQL2).execute().getNodes().getSize();

/* next instruction prints out "-1 results found" */
System.out.println(n+" results found");

where queryManager is correctly defined and my:nodetype is a nodetype
in my repository.

So, my question is: Is there any way to get the total number (or even
an estimation) of the results returned by a query?

As far as the javadoc specification of
javax.jcr.RangeIterator.getSize()  says, is should exist a method
getNumberRemaining that gives an estimation of the total number of
results, but that method is not there.

thanks!
   Rodrigo.

Mime
View raw message