Java Code Examples for com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils

The following examples show how to use com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: dble   Source File: ServerSchemaStatVisitor.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void handleCondition(SQLExpr expr, String operator, SQLExpr... valueExprs) {
    if (expr instanceof SQLCastExpr) {
        expr = ((SQLCastExpr) expr).getExpr();
    }

    Column column = this.getColumn(expr);
    if (column != null) {
        Condition condition = new Condition(column, operator);
        this.conditions.add(condition);

        SQLExpr[] var12 = valueExprs;
        int var13 = valueExprs.length;

        for (int var8 = 0; var8 < var13; ++var8) {
            SQLExpr item = var12[var8];
            Column valueColumn = this.getColumn(item);
            if (valueColumn == null) {
                if (item instanceof SQLNullExpr) {
                    condition.getValues().add(item);
                } else {
                    Object value = SQLEvalVisitorUtils.eval(this.getDbType(), item, this.getParameters(), false);
                    condition.getValues().add(value);
                }
            }
        }

    }
}