How to query for nodes without children nodes with given name in JCR?

30 Views Asked by At

I have the following node structure in the JCR:

firstNode (namespace:node1)
  |-- childNode1 (namespace:node2)
          |-- ...
  |-- childNode2 (namespace:node2)
          |-- ...
secondNode (namespace:node1)
  |-- childNode1 (namespace:node2)
          |-- ...
thirdNode (namespace:node1)
  |-- otherNode

How can I query this using JCR-SQL2 so that I will retrieve all of the parent nodes that do not have children nodes named either childNode1 or childNode2?

The end result in this case should be

/secondNode
/thirdNode
0

There are 0 best solutions below