Search in sources :

Example 1 with BLangHaving

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving in project ballerina by ballerina-lang.

the class SemanticAnalyzer method visit.

public void visit(BLangSelectClause selectClause) {
    GroupByNode groupByNode = selectClause.getGroupBy();
    if (groupByNode != null) {
        ((BLangGroupBy) groupByNode).accept(this);
    }
    HavingNode havingNode = selectClause.getHaving();
    if (havingNode != null) {
        ((BLangHaving) havingNode).accept(this);
    }
    List<? extends SelectExpressionNode> selectExpressionsList = selectClause.getSelectExpressions();
    if (selectExpressionsList != null) {
        for (SelectExpressionNode selectExpressionNode : selectExpressionsList) {
            ((BLangSelectExpression) selectExpressionNode).accept(this);
        }
    }
}
Also used : HavingNode(org.ballerinalang.model.tree.clauses.HavingNode) SelectExpressionNode(org.ballerinalang.model.tree.clauses.SelectExpressionNode) BLangSelectExpression(org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectExpression) GroupByNode(org.ballerinalang.model.tree.clauses.GroupByNode) BLangGroupBy(org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy) BLangHaving(org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving)

Example 2 with BLangHaving

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method createSiddhiHavingClause.

private void createSiddhiHavingClause(BLangSelectClause select) {
    BLangHaving having = (BLangHaving) select.getHaving();
    having.accept(this);
}
Also used : BLangHaving(org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving)

Example 3 with BLangHaving

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving in project ballerina by ballerina-lang.

the class SqlQueryBuilder method visit.

@Override
public void visit(BLangHaving having) {
    BLangBinaryExpr expr = (BLangBinaryExpr) having.getExpression();
    havingClause = new StringBuilder("having ");
    addParametrizedSQL(expr, havingClause, havingExprParams);
}
Also used : BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)

Example 4 with BLangHaving

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving in project ballerina by ballerina-lang.

the class TypeChecker method visit.

@Override
public void visit(BLangHaving having) {
    BLangExpression expr = (BLangExpression) having.getExpression();
    expr.accept(this);
}
Also used : BLangExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)

Example 5 with BLangHaving

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving in project ballerina by ballerina-lang.

the class TypeChecker method visit.

@Override
public void visit(BLangSelectClause selectClause) {
    List<? extends SelectExpressionNode> selectExprList = selectClause.getSelectExpressions();
    selectExprList.forEach(selectExpr -> ((BLangSelectExpression) selectExpr).accept(this));
    BLangGroupBy groupBy = (BLangGroupBy) selectClause.getGroupBy();
    if (groupBy != null) {
        groupBy.accept(this);
    }
    BLangHaving having = (BLangHaving) selectClause.getHaving();
    if (having != null) {
        having.accept(this);
    }
}
Also used : BLangGroupBy(org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy) BLangHaving(org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving)

Aggregations

BLangHaving (org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving)4 BLangGroupBy (org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy)2 BLangBinaryExpr (org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)2 GroupByNode (org.ballerinalang.model.tree.clauses.GroupByNode)1 HavingNode (org.ballerinalang.model.tree.clauses.HavingNode)1 SelectExpressionNode (org.ballerinalang.model.tree.clauses.SelectExpressionNode)1 BLangSelectExpression (org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectExpression)1 BLangExpression (org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)1