Hi Amir,

Amir Mistric wrote:
According to this issue (http://issues.apache.org/jira/browse/JCR-579) , Id
be better off to use SQL syntax. But now I have a different problem...How do
I achieve the same result in SQL? I haven't been able to query MetaData
part..

I think you should still use XPath and use the encoding as specified in jsr 170.

In another words this does not work:

SELECT * FROM nt:base WHERE jcr:path LIKE
'/www-site1-org/mediaroom/press/2006[%]/%' AND tag='news' AND
mgnl:template='np-article'

I am guessing because 'tag' and 'mgnl:template' are not on the same
"level"....

The query you have cannot be expressed in SQL because SQL does not support relative paths in an expression.

Any help is appreciated...

You should use XPath and encode the node name:

/jcr:root/www-site1-org/mediaroom/press/_x0032_006//element(*,nt:base)[EMAIL PROTECTED]'news' and MetaData/@mgnl:template='np-article'] order by @date descending

regards
 marcel

Reply via email to