AnsweredAssumed Answered

SQL equivalent of XPATH

Question asked by amit_wmw@yahoo.com on Apr 20, 2009
Latest reply on Apr 22, 2009 by amit_wmw@yahoo.com
Hello

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(QueryManagerImpl.java:79)
   at org.alfresco.sample.FirstJCRClient.main(FirstJCRClient.java:52)


Kindly suggest the correct SQL query.

Thanks
Amit.

Outcomes