jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <msl...@email.cz>
Subject Re: Help to convert xpath to jcr SQl2
Date Tue, 12 Feb 2013 09:48:56 GMT


-- 
Marek Slama
mslama@email.cz



---------- Původní zpráva ----------
Od: Joy <Kripa_M01@infosys.com>
Datum: 8. 2. 2013
Předmět: Help to convert xpath to jcr SQl2

"Hi


Can u plz help me to convert 
xpath :
//wiki:encyclopedia/wiki:entry[@wiki:title = 'rose ' 

to JCR SQL


is it like 

select * from [wiki:encyclopedia/wiki:entry] where wiki:title like 'rose' 
"
No it is wrong AFAIK in FROM you give type if you do not have any specific 
type give there [nt:base]




For property constraint just use = ie. equals.




Path constraint use ischildnode. Look at http://svn.apache.org/viewvc/
jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/org/apache/
jackrabbit/spi/commons/query/sql2/test.sql2.txt?view=markup for examples.




My version would be

select * from [nt:base] where ischildnode([/wiki:encyclopedia/wiki:entry]) 
and title='rose'




I recommend to use absolute path ie. starting with / it corresponds to 
original XPath.





Hope it helps




Marek

"
i want to get a hold on this

Thanks 
Joy 



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Help-to
-convert-xpath-to-jcr-SQl2-tp4657657.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com."
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message