Map<String, Subquery> subqueriesByVariableName ) {
if (constraint instanceof And) {
And and = (And)constraint;
Constraint left = replaceSubqueriesWithBindVariables(context, and.left(), subqueriesByVariableName);
Constraint right = replaceSubqueriesWithBindVariables(context, and.right(), subqueriesByVariableName);
if (left == and.left() && right == and.right()) return and;
return new And(left, right);
}
if (constraint instanceof Or) {
Or or = (Or)constraint;
Constraint left = replaceSubqueriesWithBindVariables(context, or.left(), subqueriesByVariableName);