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, sql queries and nested properties
Date Mon, 03 Jul 2006 10:14:48 GMT
Hi Piotr,

Piotr Maj wrote:
> Query query = queryManager.createQuery("select * from nt:file where 
> jcr:content.pm:description like 'To%'", Query.SQL);
 > [...]
> And I get nothing. The question is: how should the query look like?

Jackrabbit currently does not support 'nested' properties in the where 
clause. This is tracked as an enhancement in jira: 
http://issues.apache.org/jira/browse/JCR-247

> Another question is how should the query look like I wanted to find
> all nt:resource nodes where one of nested pm:annotation.pm:content
> property is equal to 'xxx'?

When this feature is implemented it will probably look different than: 
jcr:content.pm:description because the dot is a valid name character. 
maybe it will look like this:
... where jcr:content/pm:description = 'xxx'

but this is not yet defined.

> I'd appreciate if someone could write for me an SQL version of such
> query as well as XPath one and explain to me why the query I used
> is wrong?

In XPath syntax your query would look like this:
//element(*, nt:file)[jcr:like(jcr:content/@pm:description, 'To%')]

But as mentioned before this is not yet possible because of JCR-247.

regards
  marcel

Mime
View raw message