*/
private static Set collectSourceNodesInConjunct(Criteria conjunct, MappingNode context, MappingDocument mappingDoc)
throws QueryPlannerException {
Collection elements = ElementCollectorVisitor.getElements(conjunct, true);
Set resultSets = new HashSet();
String contextFullName = context.getFullyQualifiedName().toUpperCase();
//validate that each element's group is under the current context or is in the direct parentage
for (Iterator i = elements.iterator(); i.hasNext();) {
ElementSymbol elementSymbol = (ElementSymbol)i.next();
String elementFullName = elementSymbol.getCanonicalName();
MappingNode node = MappingNode.findNode(mappingDoc, elementFullName);
MappingNode elementRsNode = node.getSourceNode();
if (elementRsNode == null) {
throw new QueryPlannerException(QueryPlugin.Util.getString("CriteriaPlanner.invalid_element", elementSymbol)); //$NON-NLS-1$
}
String elementRsFullName = elementRsNode.getFullyQualifiedName().toUpperCase();
//check for a match at or below the context
if (contextFullName.equals(elementRsFullName) ||
elementRsFullName.startsWith(contextFullName + ElementSymbol.SEPARATOR)) {
resultSets.add(elementRsNode);
continue;
}
//check for match above the context
if (contextFullName.startsWith(elementRsFullName + ElementSymbol.SEPARATOR)) {