Expression left = ExpressionQualifier.qualify(session, tableAliases,
exp.getLeftExpression());
Expression right = ExpressionQualifier.qualify(session, tableAliases,
exp.getRightExpression());
BinaryExpression qualified;
if (exp instanceof Addition)
qualified = new Addition();
else if (exp instanceof Division)
qualified = new Division();
else if (exp instanceof Multiplication)
qualified = new Multiplication();
else if (exp instanceof Subtraction)
qualified = new Subtraction();
else if (exp instanceof EqualsTo)
qualified = new EqualsTo();
else if (exp instanceof GreaterThan)
qualified = new GreaterThan();
else if (exp instanceof GreaterThanEquals)
qualified = new GreaterThanEquals();
else if (exp instanceof LikeExpression)
qualified = new LikeExpression();
else if (exp instanceof MinorThan)
qualified = new MinorThan();
else if (exp instanceof MinorThanEquals)
qualified = new MinorThanEquals();
else if (exp instanceof NotEqualsTo)
qualified = new NotEqualsTo();
else
throw new IllegalArgumentException("Unknown binary expression: " + exp);
qualified.setLeftExpression(left);
qualified.setRightExpression(right);
this._qualifiedExpression = qualified;
}