use of com.developmentontheedge.sql.model.AstBooleanExpression in project be5 by DevelopmentOnTheEdge.
the class FilterApplier method addWhere.
private void addWhere(AstWhere where, Map<ColumnRef, Object> conditions) {
if (where.jjtGetNumChildren() != 0) {
if (!AstFunNode.isFunction(DefaultParserContext.AND_LIT).test(where.child(0))) {
AstFunNode and = DefaultParserContext.FUNC_AND.node();
for (SimpleNode child : where.children()) and.addChild(child instanceof AstBooleanExpression ? new AstParenthesis(child) : child);
where.removeChildren();
where.addChild(and);
}
setConditions(where.child(0), conditions);
} else if (conditions.size() > 1) {
where.addChild(DefaultParserContext.FUNC_AND.node());
setConditions(where.child(0), conditions);
} else
setConditions(where, conditions);
}
Aggregations