jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Xpath query with number
Date Wed, 02 May 2007 09:10:31 GMT
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:

and MetaData/@mgnl:template='np-article'] order by @date descending


View raw message