You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Peri Subrahmanya <pe...@gmail.com> on 2012/07/31 22:31:17 UTC

GQL query for fetching a file node by UUID

I was wondering what the query will look like if I had the UUID of the
fileNode to retrieve using GQL.

Thanks
-PeriS



Re: GQL query for fetching a file node by UUID

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 31.07.2012, at 22:31, Peri Subrahmanya <pe...@gmail.com> wrote:

> I was wondering what the query will look like if I had the UUID of the fileNode to retrieve using GQL.

In Xpath, you can do //*[@jcr:uuid='87b8648b-1fc0-4886-8e16-c439580bcf1f'], and since jackrabbit-jcr-commons GQL translates to an Xpath query internally, you might try:

"jcr:uuid":"87b8648b-1fc0-4886-8e16-c439580bcf1f"

But note that using Session.getNodeByIdentifier(String id) is simpler and faster.

Cheers,
Alex