jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rakesh Vidyadharan <rak...@sptci.com>
Subject Equivalent JCR_SQL2 statement
Date Sun, 08 Nov 2009 04:30:11 GMT
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: <end>
	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



Mime
View raw message