jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: SQL2 and references
Date Tue, 27 Sep 2011 20:39:35 GMT
Hi Lukas,

On Tue, Sep 27, 2011 at 10:20 PM, Lukas Kahwe Smith <mls@pooteeweet.org> wrote:
> I am wondering how to do a search given the following
>
> /foo/bar (UUID 1234, property "lala" is "huii")
> /ding/dong (referencing UUID 1234)
>
> now I want to do a search limited to children of "/ding" but when
> searching I want it to search the contents of referenced nodes.

As you noticed, references are not automatically followed by the query
engine. What you can do instead is to use a join query like this:

    SELECT dst.*
    FROM [nt:base] AS src
    JOIN [nt:unstructured] AS dst ON src.[reference] = dst.[jcr:uuid]
    WHERE ISCHILDNODE(src, '/ding') AND dst.lala = 'huii'

BR,

Jukka Zitting

Mime
View raw message