Did u try this tool:

http://people.apache.org/~mreutegg/jcr-query-translator/translator.html

i like it ;)


Magnolia - User mailing list wrote:
> 
> Hi
> 
> I was wondering if someone can help me translate a Xpath query into SQL
> one.
> The XPath query works like a charm untill you pass in a path with a
> number....
> 
> WORKS:
> /jcr:root/site1/news//element(*,nt:base)[EMAIL PROTECTED]'news' and
> MetaData/@mgnl:template='np-article'] order by @date descending
> 
> FAILS:
> /jcr:root/site1/news/2007//element(*,nt:base)[EMAIL PROTECTED]'news' and
> MetaData/@mgnl:template='np-article'] order by @date descending
> 
> Reason why it fails is outlined here
> (http://issues.apache.org/jira/browse/JCR-579)
> 
> 
> My attempts to convert this to SQL query have failed as it seems
> impossible to put child into a predicate...
> Here is what I have (but it does not work):
> 
> SELECT * FROM nt:base WHERE jcr:path LIKE '/site1/news/2007[%]/%' AND
> tag='news' AND mgnl:template='np-article'
> 
> 
> The query will work with one AND predicate but not both...
> 
> Any help is appreciated.
> 
> 
> Regards
> Amir
> 

-- 
View this message in context: 
http://www.nabble.com/Xpath-to-SQL-Query-with-a-number-and-subselect-tf3678196.html#a10300589
Sent from the Magnolia - User mailing list archive at Nabble.com.


----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------

Reply via email to