use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class OracleInsertStatement method cloneTo.
public void cloneTo(OracleInsertStatement x) {
super.cloneTo(x);
if (returning != null) {
x.setReturning(returning.clone());
}
if (errorLogging != null) {
x.setErrorLogging(errorLogging.clone());
}
for (SQLHint hint : hints) {
SQLHint h2 = hint.clone();
h2.setParent(x);
x.hints.add(h2);
}
}
use of com.alibaba.druid.sql.ast.SQLHint in project sharding-jdbc by dangdangdotcom.
the class AbstractMySQLVisitor method visit.
private boolean visit(final SQLExprTableSource x, final Table table) {
printToken(table.getName());
if (table.getAlias().isPresent()) {
print(' ');
print(table.getAlias().get());
}
for (SQLHint each : x.getHints()) {
print(' ');
each.accept(this);
}
return false;
}
use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class OracleStatementParser method parseInsert0_hinits.
protected void parseInsert0_hinits(SQLInsertInto insertStatement) {
if (insertStatement instanceof OracleInsertStatement) {
OracleInsertStatement stmt = (OracleInsertStatement) insertStatement;
this.getExprParser().parseHints(stmt.getHints());
} else {
List<SQLHint> hints = new ArrayList<SQLHint>(1);
this.getExprParser().parseHints(hints);
}
}
use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class OracleStatementParser method parseInsert.
public OracleStatement parseInsert() {
if (lexer.token() == Token.LPAREN) {
OracleInsertStatement stmt = new OracleInsertStatement();
parseInsert0(stmt, false);
stmt.setReturning(parseReturningClause());
stmt.setErrorLogging(parseErrorLoggingClause());
return stmt;
}
accept(Token.INSERT);
List<SQLHint> hints = new ArrayList<SQLHint>();
parseHints(hints);
if (lexer.token() == Token.INTO) {
OracleInsertStatement stmt = new OracleInsertStatement();
stmt.setHints(hints);
parseInsert0(stmt);
stmt.setReturning(parseReturningClause());
stmt.setErrorLogging(parseErrorLoggingClause());
return stmt;
}
OracleMultiInsertStatement stmt = parseMultiInsert();
stmt.setHints(hints);
return stmt;
}
use of com.alibaba.druid.sql.ast.SQLHint in project druid by alibaba.
the class SQLLateralViewTableSource method clone.
@Override
public SQLLateralViewTableSource clone() {
SQLLateralViewTableSource x = new SQLLateralViewTableSource();
x.setAlias(this.alias);
x.outer = outer;
if (this.tableSource != null) {
x.setTableSource(this.tableSource.clone());
}
if (this.method != null) {
x.setMethod(this.method.clone());
}
for (SQLName column : this.columns) {
SQLName e2 = column.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;
}
Aggregations