Search in sources :

Example 1 with JavaAggregate

use of org.h2.expression.JavaAggregate in project h2database by h2database.

the class Parser method readJavaAggregate.

private JavaAggregate readJavaAggregate(UserAggregate aggregate) {
    ArrayList<Expression> params = New.arrayList();
    do {
        params.add(readExpression());
    } while (readIfMore(true));
    Expression filterCondition;
    if (readIf("FILTER")) {
        read("(");
        read("WHERE");
        filterCondition = readExpression();
        read(")");
    } else {
        filterCondition = null;
    }
    Expression[] list = params.toArray(new Expression[0]);
    JavaAggregate agg = new JavaAggregate(aggregate, list, currentSelect, filterCondition);
    currentSelect.setGroupQuery();
    return agg;
}
Also used : Expression(org.h2.expression.Expression) ValueExpression(org.h2.expression.ValueExpression) JavaAggregate(org.h2.expression.JavaAggregate)

Aggregations

Expression (org.h2.expression.Expression)1 JavaAggregate (org.h2.expression.JavaAggregate)1 ValueExpression (org.h2.expression.ValueExpression)1