Search in sources :

Example 6 with ValueExpression

use of org.h2.expression.ValueExpression in project siena by mandubian.

the class FullText method addColumnData.

private static void addColumnData(ArrayList<String> columns, ArrayList<String> data, Expression expr) {
    if (expr instanceof ConditionAndOr) {
        ConditionAndOr and = (ConditionAndOr) expr;
        Expression left = and.getExpression(true);
        Expression right = and.getExpression(false);
        addColumnData(columns, data, left);
        addColumnData(columns, data, right);
    } else {
        Comparison comp = (Comparison) expr;
        ExpressionColumn ec = (ExpressionColumn) comp.getExpression(true);
        ValueExpression ev = (ValueExpression) comp.getExpression(false);
        String columnName = ec.getColumnName();
        columns.add(columnName);
        if (ev == null) {
            data.add(null);
        } else {
            data.add(ev.getValue(null).getString());
        }
    }
}
Also used : ValueExpression(org.h2.expression.ValueExpression) Expression(org.h2.expression.Expression) Comparison(org.h2.expression.Comparison) ValueExpression(org.h2.expression.ValueExpression) ConditionAndOr(org.h2.expression.ConditionAndOr) ExpressionColumn(org.h2.expression.ExpressionColumn)

Aggregations

ValueExpression (org.h2.expression.ValueExpression)5 Expression (org.h2.expression.Expression)4 Comparison (org.h2.expression.Comparison)3 ConditionAndOr (org.h2.expression.ConditionAndOr)3 ExpressionColumn (org.h2.expression.ExpressionColumn)3 FunctionAlias (org.h2.engine.FunctionAlias)2 ConditionInSelect (org.h2.expression.ConditionInSelect)2 Parameter (org.h2.expression.Parameter)2 StatementBuilder (org.h2.util.StatementBuilder)2 ValueString (org.h2.value.ValueString)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 ResultSet (java.sql.ResultSet)1 Timestamp (java.sql.Timestamp)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Locale (java.util.Locale)1 IgniteException (org.apache.ignite.IgniteException)1