AnsweredAssumed Answered

SQL equivalent of XPATH

Question asked by on Apr 20, 2009
Latest reply on Apr 22, 2009 by

Can anyone please suggest me SQL query equivalent of below XPATH query?

Query query = queryManager.createQuery("//app:company_home//element(*, cm:content) [jcr:contains(@cm:author, 'Amit') ]", Query.XPATH);

I can able to successfully search content with the help of above XPATH query but I am unable to execute my program using SQL statement as below.

Query query = queryManager.createQuery("select * from cm:content where jcr:path='//app:company_home' and @cm:author='Raj'", Query.SQL);

I tried with different combinations but manage to find only below mentioned error while trying to execute the program  :cry:

javax.jcr.query.InvalidQueryException: Query language sql is not supported
   at org.alfresco.jcr.query.QueryManagerImpl.createQuery(
   at org.alfresco.sample.FirstJCRClient.main(

Kindly suggest the correct SQL query.