From users-return-13239-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Sun Nov 08 04:30:46 2009 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 49658 invoked from network); 8 Nov 2009 04:30:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Nov 2009 04:30:46 -0000 Received: (qmail 80290 invoked by uid 500); 8 Nov 2009 04:30:45 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 80129 invoked by uid 500); 8 Nov 2009 04:30:44 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 80118 invoked by uid 99); 8 Nov 2009 04:30:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Nov 2009 04:30:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.64.63.171] (HELO mail.sptci.com) (208.64.63.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Nov 2009 04:30:34 +0000 Received: from localhost (localhost [127.0.0.1]) by localhost.sptci.com (Postfix) with ESMTP id 88D791D003 for ; Sat, 7 Nov 2009 20:30:12 -0800 (PST) X-Virus-Scanned: amavisd-new at sptci.com Received: from mail.sptci.com ([127.0.0.1]) by localhost (mail.sptci.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id NkgIQH92my6q for ; Sat, 7 Nov 2009 20:30:12 -0800 (PST) Received: from www.rakeshv.org (unknown [64.81.229.247]) by mail.sptci.com (Postfix) with ESMTPSA id D94671D002 for ; Sat, 7 Nov 2009 20:30:11 -0800 (PST) From: Rakesh Vidyadharan Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Equivalent JCR_SQL2 statement Date: Sat, 7 Nov 2009 22:30:11 -0600 Message-Id: To: users@jackrabbit.apache.org Mime-Version: 1.0 (Apple Message framework v1076) X-Mailer: Apple Mail (2.1076) X-Virus-Checked: Checked by ClamAV on apache.org Since XPath is deprecated in JCR 2.0, I am trying to move to JCR_SQL2 (JR-2.0-beta1). I have the following XPath query: //unitTestPage[@cms:nodeType = 'page'] I tried writing the query in SQL as: select * from nt:unstructured where jcr:path like '/%/unitTestPage' and cms:nodeType = 'page' This statement however fails with an exception: javax.jcr.query.InvalidQueryException: Query: select * from nt:(*)unstructured where jcr:path like '/%/ unitTestFolder' and cms:nodeType = 'page'; expected: at org.apache.jackrabbit.commons.query.sql2.Parser.getSyntaxError (Parser.java:968) at org.apache.jackrabbit.commons.query.sql2.Parser.createQueryObjectModel (Parser.java:124) at org.apache.jackrabbit.commons.query.sql2 .SQL2QOMBuilder.createQueryObjectModel(SQL2QOMBuilder.java:55) at org.apache.jackrabbit.core.query.QOMQueryFactory.createQuery (QOMQueryFactory.java:69) at org.apache.jackrabbit.core.query.CompoundQueryFactory.createQuery (CompoundQueryFactory.java:67) at org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery (QueryManagerImpl.java:98) Can some one tell me what I am missing? Thanks Rakesh