jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Hagen" <dha...@h1-software.de>
Subject Escaping in SQL CONTAINS clause
Date Fri, 06 Jan 2006 14:29:46 GMT
Hi,

I am struggeling with a SQL Query containing ' characters.
As I understand the spec (section 8.5.4.5), the query 

SELECT <field-list> FROM <nodetype> WHERE CONTAINS(*, 'O\'Hara') ORDER BY
<field-list>

should return all nodes having properties containing the word O'Hara .

Instead an InvalidQueryException is thrown:

javax.jcr.query.InvalidQueryException: Encountered "Hara" at line 1, column
142.
Was expecting:
    ")" ...
    
	at
org.apache.jackrabbit.core.query.sql.JCRSQLQueryBuilder.createQuery(JCRSQLQu
eryBuilder.java:141)
	at
org.apache.jackrabbit.core.query.sql.QueryBuilder.createQueryTree(QueryBuild
er.java:37)
	at
org.apache.jackrabbit.core.query.QueryParser.parse(QueryParser.java:54)
	at
org.apache.jackrabbit.core.query.lucene.QueryImpl.<init>(QueryImpl.java:125)
	at
org.apache.jackrabbit.core.query.lucene.SearchIndex.createExecutableQuery(Se
archIndex.java:301)
	at
org.apache.jackrabbit.core.query.QueryImpl.init(QueryImpl.java:93)
	at
org.apache.jackrabbit.core.SearchManager.createQuery(SearchManager.java:336)
	at
org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerIm
pl.java:87)

Where is my Error?

Thanks in Advance!

Daniel


Mime
View raw message