return sArg;
}
private void buildSearchArgument(Expression expr, Builder builder) {
if (expr instanceof BinaryExpression) {
Expression lhs = ((BinaryExpression) expr).getLhs();
Expression rhs = ((BinaryExpression) expr).getRhs();
switch (expr.getOpType()) {
case OP_AND:
builder.startAnd();
buildSearchArgument(lhs, builder);
buildSearchArgument(rhs, builder);
builder.end();
break;
case OP_OR:
builder.startOr();
buildSearchArgument(lhs, builder);
buildSearchArgument(rhs, builder);
builder.end();
break;
case OP_EQ:
builder.equals(getColumnName(lhs), getExpressionValue(rhs));
break;
case OP_NE:
builder.startNot();
builder.equals(getColumnName(lhs), getExpressionValue(rhs));
builder.end();
break;
case OP_LT:
builder.lessThan(getColumnName(lhs), getExpressionValue(rhs));
break;
case OP_LE:
builder.lessThanEquals(getColumnName(lhs), getExpressionValue(rhs));
break;
case OP_GT:
builder.startNot();
builder.lessThanEquals(getColumnName(lhs), getExpressionValue(rhs));
builder.end();
break;
case OP_GE:
builder.startNot();
builder.lessThan(getColumnName(lhs), getExpressionValue(rhs));
builder.end();
break;
case OP_BETWEEN:
BetweenExpression between = (BetweenExpression) rhs;
builder.between(getColumnName(lhs), getSearchArgObjValue(between.getLower()), getSearchArgObjValue(between.getUpper()));
case OP_IN:
InExpression in = (InExpression) rhs;
builder.in(getColumnName(lhs), getSearchArgObjValues(in.getValues()).toArray());
default:
throw new RuntimeException("Unsupported binary expression type: " + expr.getOpType() + " in " + expr);
}
} else if (expr instanceof UnaryExpression) {
Expression unaryExpr = ((UnaryExpression) expr).getExpression();
switch (expr.getOpType()) {
case OP_NULL:
builder.isNull(getColumnName(unaryExpr));
break;
case OP_NOT: