0
votes

I have the following JCR-SQL2-Query:

SELECT * FROM [nt:base] AS nodes WHERE NAME(nodes) = 'NameOfTheNode'

Right now I get all the nodes with the name 'NameOfTheNode'. But I want to limit the results to nodes that are empty respectively have no child nodes.

How could I do that?

1

1 Answers

0
votes

According to https://docs.jboss.org/author/display/MODE50/JCR-SQL2#JCR-SQL2-SinceModeShape4.0: it is not possible to query nodes with no children in JCR-SQL2:

Additional dynamic operand "CHILDCOUNT(selectorName)" that enables placing constraints on the number of children. Although there are several ways to use it, this is especially effective for finding nodes with no children, which cannot otherwise be done in JCR-SQL2 (it is not possible to use an anti-join with CHILDNODE join criteria).