DynamicOperand lhs = replaceAliasesWithProperties(context, comparison.getOperand1(), propertyByAlias);
if (lhs == comparison.getOperand1()) return comparison;
return new Comparison(lhs, comparison.operator(), comparison.getOperand2());
}
if (constraint instanceof Relike) {
Relike relike = (Relike)constraint;
StaticOperand op1 = relike.getOperand1();
PropertyValue op2 = relike.getOperand2();
PropertyValue newOp2 = replaceAliasesWithProperties(context, op2, propertyByAlias);
if (op2 == newOp2) return relike;
return new Relike(op1, op2);
}
if (constraint instanceof SetCriteria) {
SetCriteria criteria = (SetCriteria)constraint;
DynamicOperand lhs = replaceAliasesWithProperties(context, criteria.leftOperand(), propertyByAlias);
if (lhs == criteria.leftOperand()) return criteria;