Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 73814 invoked from network); 17 Feb 2010 13:13:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2010 13:13:51 -0000 Received: (qmail 40667 invoked by uid 500); 17 Feb 2010 13:13:51 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 40601 invoked by uid 500); 17 Feb 2010 13:13:51 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 40593 invoked by uid 99); 17 Feb 2010 13:13:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 13:13:51 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of 1111software@gmail.com designates 209.85.218.224 as permitted sender) Received: from [209.85.218.224] (HELO mail-bw0-f224.google.com) (209.85.218.224) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 13:13:39 +0000 Received: by bwz24 with SMTP id 24so4148923bwz.9 for ; Wed, 17 Feb 2010 05:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=p/xH1akt7HBUT2K6klApo/3iI+KDmHmO10NtGc8LF1w=; b=QX+h/LhsKRF2cbTTFYYaMXdbwzlo5HSN2HZ6LtPxS9T80qzOmfa5DlvuOq0yfZ35Ez hON209+GmPQ0AZ9M/SLqjY3vkNuS7H2ETQ6Ny1SpTv0fAwXOnX9EgNDKD5fIoZuUdpjO 2ioilAeO5LHQb43+dtlhnu+nHnFBvZtmq54as= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=IJwDC75tojoMZzb1q4xrDbYyAIxf/sKVE1t63yow8vgj3v+jZNDf4LLuaCSR25VARO 2n8kIi18FSNH7fLDoAsrSn4Pe4xlRFJbmmLQZkE4XOKsFNmxa1LwfnGVq8HBd3sYl97G hwwZ0yBbxGG9KX0xB7oRl0AmTF7dSfcz0Fd1Q= MIME-Version: 1.0 Received: by 10.204.152.214 with SMTP id h22mr5355376bkw.125.1266412399584; Wed, 17 Feb 2010 05:13:19 -0800 (PST) In-Reply-To: <510143ac1002170144ra3eb39brd148c0336246a42@mail.gmail.com> References: <510143ac1002170144ra3eb39brd148c0336246a42@mail.gmail.com> Date: Wed, 17 Feb 2010 14:13:19 +0100 Message-ID: Subject: Re: Queries not working in Jackrabbit 2.0 From: Jacco van Weert <1111software@gmail.com> To: dev@jackrabbit.apache.org Content-Type: multipart/alternative; boundary=0015175cb4ba377542047fcb9d62 X-Virus-Checked: Checked by ClamAV on apache.org --0015175cb4ba377542047fcb9d62 Content-Type: text/plain; charset=ISO-8859-1 Achhhh... now I see... I did rely on the getSize() method of the NodeIterator. Looking through the docs and the mailinglist I see that there is no real way of retrieving the number of results? gr, Jacco On Wed, Feb 17, 2010 at 10:44 AM, Jukka Zitting wrote: > Hi, > > On Wed, Feb 17, 2010 at 10:18 AM, Jacco van Weert > <1111software@gmail.com> wrote: > > For some time I am battling with the queries in Jackrabbit v2.0. > > For some reason all my query results (QueryResult .getNodes() ) are > > resulting in a -1 size, I guess this indicates an error, otherwise it > should > > be 0. > > "[...] In some implementations precise information about the number of > elements may not be available. In such cases this method must return > -1. [...]" > > http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/RangeIterator.html#getSize() > > You'll get an exception if the query execution fails for some reason. > > BR, > > Jukka Zitting > -- ------------------------------------- Jacco van Weert -- 1111software@gmail.com JCR Controller -- http://www.xs4all.nl/~weertj/jcr JeCARS -- http://kenai.com/projects/jecars --0015175cb4ba377542047fcb9d62 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Achhhh... now I see... I did rely on the getSize() meth= od of the NodeIterator.

Looking through the docs a= nd the mailinglist I see that there is no real way of retrieving the number= of results?

gr,

=A0=A0 Jacco


On Wed, Feb 17, 2010 at 10:44 AM,= Jukka Zitting <jukka.zitting@gmail.com> wrote:
Hi,

On Wed, Feb 17, 2010 at 10:18 AM, Jacco van Weert
<1111software@gmail.com>= ; wrote:
> For some time I am battling with the queries in Jackrabbit v2.0.
> For some reason all my query results (QueryResult .getNodes() ) are > resulting in a -1 size, I guess this indicates an error, otherwise it = should
> be 0.

"[...] In some implementations precise information about the num= ber of
elements may not be available. In such cases this method must return
-1. [...]"
http://www.day.com/maven/java= x.jcr/javadocs/jcr-2.0/javax/jcr/RangeIterator.html#getSize()

You'll get an exception if the query execution fails for some reason.
BR,

Jukka Zitting



--
----------------= ---------------------
Jacco van Weert -- 1111software@gmail.com
JCR Controller -- http://www.xs4all.nl/~weertj/jcr
JeCARS -- http://kenai.com/pro= jects/jecars

--0015175cb4ba377542047fcb9d62--