The following query needs to check if a childClassId with the given id has a (grand-grand-)parent with the second given id. A boolean true / false answer is actually enough here