use of com.developmentontheedge.sql.model.Node in project be5 by DevelopmentOnTheEdge.
the class MySqlTransformer method transformConcat.
@Override
protected void transformConcat(AstFunNode node) {
if (isConcat(node))
return;
node.setFunction(parserContext.getFunction("concat"));
List<SimpleNode> flatChildren = node.children().flatMap(child -> isConcat(child) ? child.children() : Stream.of(child)).toList();
node.removeChildren();
flatChildren.forEach(node::addChild);
SimpleNode parent = node.jjtGetParent();
if (parent instanceof AstParenthesis)
parent.replaceWith(node);
}
use of com.developmentontheedge.sql.model.Node in project be5 by DevelopmentOnTheEdge.
the class MySqlTransformer method transformIdentifier.
@Override
protected void transformIdentifier(AstIdentifierConstant identifier) {
if (identifier.getQuoteSymbol() == QuoteSymbol.DOUBLE_QUOTE) {
Node parent = identifier.jjtGetParent();
if (parent instanceof AstDerivedColumn)
return;
identifier.setQuoteSymbol(QuoteSymbol.BACKTICK);
}
if (identifier.getValue().equalsIgnoreCase("current_timestamp")) {
identifier.replaceWith(parserContext.getFunction("now").node());
}
}
Aggregations