SelectorName selector = mapping.getSingleMappedSelectorName();
node.addSelector(selector);
return new ChildNode(selector, childNode.getParentPath());
}
if (constraint instanceof DescendantNode) {
DescendantNode descendantNode = (DescendantNode)constraint;
if (!mapping.getOriginalName().equals(descendantNode.selectorName())) return descendantNode;
if (!mapping.isMappedToSingleSelector()) return descendantNode;
SelectorName selector = mapping.getSingleMappedSelectorName();
node.addSelector(selector);
return new DescendantNode(selector, descendantNode.getAncestorPath());
}
if (constraint instanceof PropertyExistence) {
PropertyExistence existence = (PropertyExistence)constraint;
if (!mapping.getOriginalName().equals(existence.selectorName())) return existence;
Column sourceColumn = mapping.getMappedColumn(existence.getPropertyName());