From dev-return-27013-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Mon Feb 08 14:07:50 2010 Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 71135 invoked from network); 8 Feb 2010 14:07:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Feb 2010 14:07:50 -0000 Received: (qmail 65999 invoked by uid 500); 8 Feb 2010 14:07:49 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 65628 invoked by uid 500); 8 Feb 2010 14:07:49 -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 65620 invoked by uid 99); 8 Feb 2010 14:07:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 14:07:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2010 14:07:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E5862234C1EE for ; Mon, 8 Feb 2010 06:07:27 -0800 (PST) Message-ID: <581207866.121081265638047938.JavaMail.jira@brutus.apache.org> Date: Mon, 8 Feb 2010 14:07:27 +0000 (UTC) From: "Marcel Reutegger (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-2417) RepositoryException when using BindVariables in JCR-SQL2 CONTAINS In-Reply-To: <692903965.1259687900642.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-2417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marcel Reutegger updated JCR-2417: ---------------------------------- Resolution: Fixed Fix Version/s: 2.1.0 Status: Resolved (was: Patch Available) Applied patch with minor changes (see below) to trunk in revision: 907659 Fixed a minor javadoc issue and exception type in LuceneQueryFactoryImpl. Thanks a lot for the patch. > RepositoryException when using BindVariables in JCR-SQL2 CONTAINS > ----------------------------------------------------------------- > > Key: JCR-2417 > URL: https://issues.apache.org/jira/browse/JCR-2417 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: query > Affects Versions: 2.0-beta3, 2.0.0 > Reporter: Philipp Bunge > Fix For: 2.1.0 > > Attachments: contains_with_bind_variable.patch > > > When using a BindVariable in a JCR-SQL2 CONTAINS constraint, the query fails with a RepositoryException. > For example: > String sql = "SELECT * FROM [nt:unstructured] WHERE ISCHILDNODE([/testroot]) AND CONTAINS(mytext, $searchExpression)"; > Query q = superuser.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2); > q.bindValue("searchExpression", superuser.getValueFactory().createValue("fox")); > q.execute(); > Results in: > javax.jcr.RepositoryException: Unknown static operand type: org.apache.jackrabbit.spi.commons.query.qom.BindVariableValueImpl@591a4d > at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactoryImpl.create(LuceneQueryFactoryImpl.java:215) > at org.apache.jackrabbit.core.query.lucene.constraint.FullTextConstraint.(FullTextConstraint.java:42) > at org.apache.jackrabbit.core.query.lucene.constraint.ConstraintBuilder$Visitor.visit(ConstraintBuilder.java:175) > at org.apache.jackrabbit.spi.commons.query.qom.FullTextSearchImpl.accept(FullTextSearchImpl.java:117) > at org.apache.jackrabbit.core.query.lucene.constraint.ConstraintBuilder$Visitor.visit(ConstraintBuilder.java:137) > at org.apache.jackrabbit.spi.commons.query.qom.AndImpl.accept(AndImpl.java:72) > at org.apache.jackrabbit.core.query.lucene.constraint.ConstraintBuilder.create(ConstraintBuilder.java:82) > at org.apache.jackrabbit.core.query.lucene.QueryObjectModelImpl.execute(QueryObjectModelImpl.java:109) > at org.apache.jackrabbit.core.query.QueryImpl.execute(QueryImpl.java:127) > I tried to fix this issue but there is no way to access the BindVariables from the ConstraintBuilder from the LuceneQueryFactoryImpl and the ConstraintBuilder just passes the FullTextSearchImpl QOM subtree to the factory (via FullTextConstraint constructor) without any further visiting. If the signature would be "LuceneQueryFactoryImpl#create(FullTextSearchImpl fts, Value searchExpression)" we could visit the StaticOperand in the ConstraintBuilder and then modify the FullTextSearchImpl constructor accordingly, but this would imply that LuceneQueryFactory interface would need to be change accordingly and I don't know what that would mean. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.