use of org.ballerinalang.model.tree.clauses.WhereNode in project ballerina by ballerina-lang.
the class SqlQueryBuilder method visit.
@Override
public void visit(BLangStreamingInput streamingInput) {
streamingInputClause = new StringBuilder();
BLangExpression tableReference = (BLangExpression) streamingInput.getStreamReference();
tableReference.accept(this);
exprStack.pop();
streamingInputClause.append("(select * from [[tableName]]");
WhereNode where = streamingInput.getBeforeStreamingCondition();
if (where == null) {
where = streamingInput.getAfterStreamingCondition();
}
/* for tables there can only be one whereClause and there is no windowClause.
So we don't care about the windowClause. */
if (where != null) {
((BLangWhere) where).accept(this);
streamingInputClause.append(" ").append(whereClause);
}
streamingInputClause.append(")");
if (streamingInput.getAlias() != null) {
streamingInputClause.append(" as ").append(streamingInput.getAlias());
}
}
Aggregations