improved schemastat

This commit is contained in:
高铁
2015-11-03 14:24:10 +08:00
parent 8cbaefe173
commit 2107d236c0
10 changed files with 173 additions and 38 deletions
@@ -24,14 +24,16 @@ import com.alibaba.druid.sql.visitor.SQLASTVisitor;
public class SQLCreateTableStatement extends SQLStatementImpl implements SQLDDLStatement {
protected boolean ifNotExiists = false;
protected Type type;
protected SQLExprTableSource tableSource;
protected boolean ifNotExiists = false;
protected Type type;
protected SQLExprTableSource tableSource;
protected List<SQLTableElement> tableElementList = new ArrayList<SQLTableElement>();
// for postgresql
private SQLExprTableSource inherits;
private SQLExprTableSource inherits;
protected SQLSelect select;
public SQLCreateTableStatement(){
@@ -73,7 +75,7 @@ public class SQLCreateTableStatement extends SQLStatementImpl implements SQLDDLS
}
public static enum Type {
GLOBAL_TEMPORARY, LOCAL_TEMPORARY
GLOBAL_TEMPORARY, LOCAL_TEMPORARY
}
public List<SQLTableElement> getTableElementList() {
@@ -99,12 +101,21 @@ public class SQLCreateTableStatement extends SQLStatementImpl implements SQLDDLS
this.inherits = inherits;
}
public SQLSelect getSelect() {
return select;
}
public void setSelect(SQLSelect select) {
this.select = select;
}
@Override
protected void accept0(SQLASTVisitor visitor) {
if (visitor.visit(this)) {
this.acceptChild(visitor, tableSource);
this.acceptChild(visitor, tableElementList);
this.acceptChild(visitor, inherits);
this.acceptChild(visitor, select);
}
visitor.endVisit(this);
}