jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Kahwe Smith <...@pooteeweet.org>
Subject Re: SQL2 and references
Date Thu, 06 Oct 2011 12:15:13 GMT

On Sep 30, 2011, at 14:01 , Lukas Kahwe Smith wrote:

> 
> On Sep 30, 2011, at 13:25 , Jukka Zitting wrote:
> 
>> Hi,
>> 
>> On Fri, Sep 30, 2011 at 11:05 AM, Lukas Kahwe Smith <mls@pooteeweet.org> wrote:
>>> @Jukka: could this really mean that JOIN's simply do not work via Davex?
>> 
>> Yes, that's what I was referring to in my previous message. Most of
>> the davex remoting layer was built before JCR 2.0, so new concepts
>> like multiple selectors per result set may well not yet be supported.
>> I didn't check the code yet, but it should be fairly easy to track the
>> server-side code down to see if it's using Row.getNode() or
>> Row.getNode(String).
> 
> 
> ok thx .. will see if we at Liip can figure this out. in the mean time i have created
a ticket:
> https://issues.apache.org/jira/browse/JCR-3089


ok running a patched 2.3 with the fix from the above ticket I can now do JOIN's via Davex.

but now i am running into trouble with the original query I needed:

SELECT data.* FROM [nzz:unstructured] AS data LEFT OUTER JOIN [nzz:unstructured] AS referring
ON
                (
                    (referring.reference = data.[jcr:uuid] AND ISDESCENDANTNODE(referring,
'/article/2011/01/10'))
                    OR ISDESCENDANTNODE([nzz:unstructured], '/article/2011/01/10')
                )

The goal would be to get all [nt:unstructured] nodes that are either direct descendants of
the path '/article/2011/01/10' or that have a defendant node of '/article/2011/01/10' that
references them.

So given this structure:
/article/2011/01/10/foo@reference=1234
/article/2011/01/10/bar
/article/2011/01/09/ding@uuid=1234

I want it to return:
/article/2011/01/10/bar
/article/2011/01/09/ding@uuid=1234

However when sending the above query via Davex I get:

<?xml version="1.0"?>
<response><status><![CDATA[error]]></status><status_code>500</status_code><status_text><![CDATA[Internal
Server Error]]></status_text><currentContent><![CDATA[]]></currentContent><message><![CDATA[HTTP
400: Query:
SELECT data.* FROM [nzz:unstructured] AS data LEFT OUTER JOIN [nzz:unstructured] AS referring
ON
                (
                    ((*)referring.reference = data.[jcr:uuid] AND ISDESCENDANTNODE(referring,
'/article/2011/01/10'))
                    OR ISDESCENDANTNODE([nzz:unstructured], '/article/2011/01/10')
                ); expected: .]]></message></response>

Not sure where its expecting the "."

Also if I move the ISDESCENDANTNODE() checks to the WHERE it the query doesnt explode, but
obviously I will get additional rows due to the LEFT OUTER JOIN

regards,
Lukas Kahwe Smith
mls@pooteeweet.org




Mime
View raw message