<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SQL equivalent of XPATH in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/sql-equivalent-of-xpath/m-p/193240#M146370</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone please suggest me SQL query equivalent of below XPATH query?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;Query query = queryManager.createQuery("//app:company_home//element(*, cm:content) [jcr:contains(@cm:author, 'Amit') ]", Query.XPATH);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;Query query = queryManager.createQuery("select * from cm:content where jcr:path='//app:company_home' and @cm:author='Raj'", Query.SQL);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried with different combinations but manage to find only below mentioned error while trying to execute the program&amp;nbsp; :cry: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;javax.jcr.query.InvalidQueryException: Query language sql is not supported&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.jcr.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:79)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.sample.FirstJCRClient.main(FirstJCRClient.java:52)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kindly suggest the correct SQL query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Amit.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Apr 2009 12:09:00 GMT</pubDate>
    <dc:creator>amit_wmw</dc:creator>
    <dc:date>2009-04-20T12:09:00Z</dc:date>
    <item>
      <title>SQL equivalent of XPATH</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/sql-equivalent-of-xpath/m-p/193240#M146370</link>
      <description>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 un</description>
      <pubDate>Mon, 20 Apr 2009 12:09:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/sql-equivalent-of-xpath/m-p/193240#M146370</guid>
      <dc:creator>amit_wmw</dc:creator>
      <dc:date>2009-04-20T12:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL equivalent of XPATH</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/sql-equivalent-of-xpath/m-p/193241#M146371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no SQL query language implementation - despite the static option that suggests otherwise.&amp;nbsp; Using the XPath query with the &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;…//element…&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; would be horrendous (as I'm sure you've discovered) because it has to walk the entire hierarchy and look at the properties of every node do determine who authored a particular document.&amp;nbsp; Lucene should be used for this type of query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 08:34:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/sql-equivalent-of-xpath/m-p/193241#M146371</guid>
      <dc:creator>derek</dc:creator>
      <dc:date>2009-04-21T08:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL equivalent of XPATH</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/sql-equivalent-of-xpath/m-p/193242#M146372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Derek&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your suggestions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, Xpath is slow. Moreover I think there is no way in XPATH to query and retrieve nodes created between two time slots (i.e. say: to retrieve nodes created between 12.00 PM to 03.00 PM), as &amp;lt;= or &amp;gt;= does not works! While there seems to be a possibility for the same in Lucene using range queries. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know how to use Lucene through Alfresco API(SearchService) but using pure JCR API how can we do it? Is there any basic example/sample for the same? Can anybody please share.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amit.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 11:10:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/sql-equivalent-of-xpath/m-p/193242#M146372</guid>
      <dc:creator>amit_wmw</dc:creator>
      <dc:date>2009-04-22T11:10:47Z</dc:date>
    </item>
  </channel>
</rss>

