return new DescendantNode(selector, descendantNode.getAncestorPath());
}
if (constraint instanceof PropertyExistence) {
PropertyExistence existence = (PropertyExistence)constraint;
if (!mapping.getOriginalName().equals(existence.getSelectorName())) return existence;
Column sourceColumn = mapping.getMappedColumn(existence.getPropertyName());
if (sourceColumn == null) return existence;
node.addSelector(sourceColumn.getSelectorName());
return new PropertyExistence(sourceColumn.getSelectorName(), sourceColumn.getPropertyName());
}
if (constraint instanceof FullTextSearch) {
FullTextSearch search = (FullTextSearch)constraint;
if (!mapping.getOriginalName().equals(search.getSelectorName())) return search;
Column sourceColumn = mapping.getMappedColumn(search.getPropertyName());
if (sourceColumn == null) return search;
node.addSelector(sourceColumn.getSelectorName());
return new FullTextSearch(sourceColumn.getSelectorName(), sourceColumn.getPropertyName(),
search.getFullTextSearchExpression());
}
if (constraint instanceof Between) {
Between between = (Between)constraint;
DynamicOperand lhs = between.getOperand();