org.babyfish.jimmer.sql.ast.impl.ConcatExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-sql Show documentation
Show all versions of jimmer-sql Show documentation
A revolutionary ORM framework for both java and kotlin
package org.babyfish.jimmer.sql.ast.impl;
import org.babyfish.jimmer.sql.ast.Expression;
import org.babyfish.jimmer.sql.runtime.SqlBuilder;
import java.util.List;
class ConcatExpression
extends AbstractExpression
implements StringExpressionImplementor {
private Expression first;
private List> others;
ConcatExpression(Expression first, List> others) {
this.first = first;
this.others = others;
}
@Override
public void accept(AstVisitor visitor) {
((Ast) first).accept(visitor);
for (Expression> other : others) {
((Ast) other).accept(visitor);
}
}
@Override
public void renderTo(SqlBuilder builder) {
builder.sql("concat(");
renderChild((Ast) first, builder);
for (Expression> other : others) {
builder.sql(", ");
renderChild((Ast) other, builder);
}
builder.sql(")");
}
@Override
public int precedence() {
return 0;
}
}