Search in sources :

Example 1 with SQLHint

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);
        }
    }
}
Also used : MySqlOutputVisitor(com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor) SQLHint(com.alibaba.druid.sql.ast.SQLHint)

Example 2 with SQLHint

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;
}
Also used : SQLName(com.alibaba.druid.sql.ast.SQLName) SQLHint(com.alibaba.druid.sql.ast.SQLHint) SQLListExpr(com.alibaba.druid.sql.ast.expr.SQLListExpr)

Example 3 with SQLHint

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;
}
Also used : SQLHint(com.alibaba.druid.sql.ast.SQLHint)

Example 4 with SQLHint

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;
}
Also used : SQLParameter(com.alibaba.druid.sql.ast.SQLParameter) SQLHint(com.alibaba.druid.sql.ast.SQLHint)

Example 5 with SQLHint

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;
}
Also used : SQLHint(com.alibaba.druid.sql.ast.SQLHint)

Aggregations

SQLHint (com.alibaba.druid.sql.ast.SQLHint)11 SQLName (com.alibaba.druid.sql.ast.SQLName)2 OracleInsertStatement (com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleInsertStatement)2 ArrayList (java.util.ArrayList)2 SQLParameter (com.alibaba.druid.sql.ast.SQLParameter)1 SQLListExpr (com.alibaba.druid.sql.ast.expr.SQLListExpr)1 MySqlOutputVisitor (com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor)1 OracleMultiInsertStatement (com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleMultiInsertStatement)1