Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 34191 invoked from network); 5 Feb 2010 09:40:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Feb 2010 09:40:53 -0000 Received: (qmail 37844 invoked by uid 500); 5 Feb 2010 09:40:52 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 37761 invoked by uid 500); 5 Feb 2010 09:40:52 -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 37680 invoked by uid 99); 5 Feb 2010 09:40:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Feb 2010 09:40:51 +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; Fri, 05 Feb 2010 09:40:49 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F210A29A0025 for ; Fri, 5 Feb 2010 01:40:27 -0800 (PST) Message-ID: <1049381804.64921265362827990.JavaMail.jira@brutus.apache.org> Date: Fri, 5 Feb 2010 09:40:27 +0000 (UTC) From: "Philipp Bunge (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 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-2417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Philipp Bunge updated JCR-2417: ------------------------------- Attachment: (was: contains_with_bind_variable.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 > 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.