use of com.alibaba.druid.sql.ast.SQLHint in project dble by actiontech.
the class MysqlVisitor method buildTableName.
protected void buildTableName(TableNode tableNode, StringBuilder sb) {
sb.append(" `").append(tableNode.getPureName()).append("`");
String alias = tableNode.getAlias();
if (alias != null) {
sb.append(" `").append(alias).append("`");
}
List<SQLHint> hintList = tableNode.getHintList();
if (hintList != null && !hintList.isEmpty()) {
sb.append(' ');
boolean isFirst = true;
for (SQLHint hint : hintList) {
if (isFirst)
isFirst = false;
else
sb.append(" ");
MySqlOutputVisitor ov = new MySqlOutputVisitor(sb);
hint.accept(ov);
}
}
}
use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class SQLValuesTableSource method clone.
@Override
public SQLValuesTableSource clone() {
SQLValuesTableSource x = new SQLValuesTableSource();
x.setAlias(this.alias);
for (SQLListExpr e : this.values) {
SQLListExpr e2 = e.clone();
e2.setParent(x);
x.getValues().add(e2);
}
for (SQLName e : this.columns) {
SQLName e2 = e.clone();
e2.setParent(x);
x.getColumns().add(e2);
}
if (this.flashback != null) {
x.setFlashback(this.flashback.clone());
}
if (this.hints != null) {
for (SQLHint e : this.hints) {
SQLHint e2 = e.clone();
e2.setParent(x);
x.getHints().add(e2);
}
}
return x;
}
use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class SQLUnionQueryTableSource method clone.
@Override
public SQLUnionQueryTableSource clone() {
SQLUnionQueryTableSource x = new SQLUnionQueryTableSource(this.union.clone(), alias);
if (this.flashback != null) {
x.setFlashback(this.flashback.clone());
}
if (this.hints != null) {
for (SQLHint e : this.hints) {
SQLHint e2 = e.clone();
e2.setParent(x);
x.getHints().add(e2);
}
}
return x;
}
use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class PGFunctionTableSource method clone.
@Override
public PGFunctionTableSource clone() {
PGFunctionTableSource x = new PGFunctionTableSource();
x.setAlias(this.alias);
for (SQLParameter e : this.parameters) {
SQLParameter e2 = e.clone();
e2.setParent(x);
x.getParameters().add(e2);
}
if (this.flashback != null) {
x.setFlashback(this.flashback.clone());
}
if (this.hints != null) {
for (SQLHint e : this.hints) {
SQLHint e2 = e.clone();
e2.setParent(x);
x.getHints().add(e2);
}
}
return x;
}
use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class MySqlUpdateTableSource method clone.
@Override
public MySqlUpdateTableSource clone() {
MySqlUpdateTableSource x = new MySqlUpdateTableSource(this.update);
x.setAlias(this.alias);
if (this.flashback != null) {
x.setFlashback(this.flashback.clone());
}
if (this.hints != null) {
for (SQLHint e : this.hints) {
SQLHint e2 = e.clone();
e2.setParent(x);
x.getHints().add(e2);
}
}
return x;
}
Aggregations