jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davide Maestroni <davide.maestr...@gmail.com>
Subject Help with JCR-SQL2 query
Date Thu, 25 Mar 2010 18:01:31 GMT
Hi,

I have a question about the use of JCR-SQL2 for querying the repository.
What I have is an absolute path to a node storing the path of another node
in one of its properties.
What I want to achieve is to get the second node through a query.
The query I wrote is like this:

SELECT a.* FROM [TypeA] AS a INNER JOIN [TypeB] AS b ON b.[pathToA] =
a.[jcr:path] WHERE ISSAMENODE(b, [/root/repb/1234])

Where "/root/repb/1234" is the absolute path to a node which has the
property "pathToA" equals to "/root/repa/79".
Even if the node with absolute path "/root/repa/79" exists and is of the
right type "TypeA", the result of the query is empty.
I guess the problem is that the path of a node is handled in a special way
and cannot just be read from the "jcr:path" property.

Is it possible to write a query in JCR-SQL2 which does what I would like to
do?

I didn't even try to write a query using XPath since it is deprecated in
JCR2.0 and I prefer to use paths instead of uuids to reference a node.
Can anyone suggest me a way to get the "/root/repa/79" node other than
calling the Java APIs?

Thanks,

Davide

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message