jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <msl...@email.cz>
Subject Re: Problem with SQL2 query
Date Tue, 26 Feb 2013 10:21:45 GMT
>From Jackrabbit sources (LuceneQueryFactory.java:638) it looks like NAME() 
can be used only with equals operator. Otherwise exception is thrown. It is 
the same in Jackrabbit 2.6.0. So I will use workaround with node property.

Marek

-- 
Marek Slama
mslama@email.cz



---------- Původní zpráva ----------
Od: mslama@email.cz
Datum: 25. 2. 2013
Předmět: Problem with SQL2 query

"Hi,

I am trying to rewrite one of my XPath query to SQL2 query.

Original XPath query:
/taxonomyClasses/*[jcr:like(fn:name(),'%\_0')]

SQL2 query:
SELECT * FROM [nt:base] WHERE NAME() LIKE '%\_0' and ISCHILDNODE([/
taxonomyClasses])

Underscore is escaped because it is literal in string constant. I am looking
for nodes which are child nodes of rootnode 
/taxonomyClasses and their node name ends with '_0'

Jackrabbit 2.4.0

But I get:
Caused by: javax.jcr.UnsupportedRepositoryOperationException
        at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.
getNodeNameQuery(LuceneQueryFactory.java:638) [jackrabbit-core-2.4.0.jar:
2.4.0]
        at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.
getComparisonQuery(LuceneQueryFactory.java:624) [jackrabbit-core-2.4.0.jar:
2.4.0]
        at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.
mapConstraintToQueryAndFilter(LuceneQueryFactory.java:400) [jackrabbit-core-
2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.
mapConstraintToQueryAndFilter(LuceneQueryFactory.java:359) [jackrabbit-core-
2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.
execute(LuceneQueryFactory.java:210) [jackrabbit-core-2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute
(QueryEngine.java:460) [jackrabbit-core-2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute
(QueryEngine.java:126) [jackrabbit-core-2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute
(QueryEngine.java:115) [jackrabbit-core-2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform
(QueryObjectModelImpl.java:129) [jackrabbit-core-2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.QueryObjectModelImpl$2.perform
(QueryObjectModelImpl.java:124) [jackrabbit-core-2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.session.SessionState.perform
(SessionState.java:216) [jackrabbit-core-2.4.0.jar:2.4.0]
        at org.apache.jackrabbit.core.query.QueryObjectModelImpl.execute
(QueryObjectModelImpl.java:123) [jackrabbit-core-2.4.0.jar:2.4.0]
        at com.idc.publishing.metacop.repository.TimedQueryManager.
executeTimedQuery(TimedQueryManager.java:42) [classes:]
        at com.idc.publishing.metacop.repository.TaxonomyRepositoryImpl.
getTaxonomyList(TaxonomyRepositoryImpl.java:512) [classes:]
        ... 62 more

Is it bug in Jackrabbit? Unsupported NAME() function in SQL2? Anything else?

Thanks

Marek"
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message