mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -11,7 +11,7 @@ import com.alibaba.druid.sql.ast.statement.SQLInsertStatement.ValuesClause;
|
||||
public abstract class SQLInsertInto extends SQLObjectImpl {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected SQLName tableName;
|
||||
protected SQLExprTableSource tableSource;
|
||||
protected String alias;
|
||||
|
||||
protected final List<SQLExpr> columns = new ArrayList<SQLExpr>();
|
||||
@@ -30,12 +30,24 @@ public abstract class SQLInsertInto extends SQLObjectImpl {
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
public SQLExprTableSource getTableSource() {
|
||||
return tableSource;
|
||||
}
|
||||
|
||||
public void setTableSource(SQLExprTableSource tableSource) {
|
||||
this.tableSource = tableSource;
|
||||
}
|
||||
|
||||
public SQLName getTableName() {
|
||||
return tableName;
|
||||
return (SQLName) tableSource.getExpr();
|
||||
}
|
||||
|
||||
public void setTableName(SQLName tableName) {
|
||||
this.tableName = tableName;
|
||||
this.setTableSource(new SQLExprTableSource(tableName));
|
||||
}
|
||||
|
||||
public void setTableSource(SQLName tableName) {
|
||||
this.setTableSource(new SQLExprTableSource(tableName));
|
||||
}
|
||||
|
||||
public SQLSelect getQuery() {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SQLInsertStatement extends SQLInsertInto implements SQLStatement {
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
this.acceptChild(visitor, tableName);
|
||||
this.acceptChild(visitor, tableSource);
|
||||
this.acceptChild(visitor, columns);
|
||||
this.acceptChild(visitor, values);
|
||||
this.acceptChild(visitor, query);
|
||||
|
||||
Reference in New Issue
Block a user