jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Byrne <step...@sbyrne.net>
Subject Condition on left outer joined node's property
Date Wed, 22 May 2013 22:14:38 GMT
I would like to have a query condition based on a property of a node 
selected by a left outer join. If the left joined node exists, I have no 
problem. If the left joined node does not exist, I cannot use the 
property in a constraint.

I tried doing something like this:

SELECT *
FROM [m:foo] AS foo
LEFT OUTER JOIN [m:foochild] AS maybe ON ISSAMENODE(maybe,foo,'fc1')
WHERE maybe.bar <> 'X'

I understand that this is like SQL and the where clause will evaluate to 
false if maybe.bar is null. So I tried this:

SELECT *
FROM [m:foo] AS foo
LEFT OUTER JOIN [m:foochild] AS maybe ON ISSAMENODE(maybe,foo,'foo')
WHERE maybe.bar IS NULL OR maybe.bar <> 'X'

But that also returns null if maybe is null. So I tried:

SELECT *
FROM [m:foo] AS foo
LEFT OUTER JOIN [m:foochild] AS maybe ON ISSAMENODE(maybe,foo,'foo')
WHERE NOT maybe.bar IS NOT NULL OR maybe.bar <> 'X'

But that does not work either.

Is there a way to get something to evaluate to true if a left outer 
joined node is null?

-- 
Stephen Byrne
stephen@sbyrne.net

Mime
View raw message