mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
sql desensitize support.
This commit is contained in:
@@ -30,7 +30,7 @@ public class SQLCreateViewStatement extends SQLStatementImpl implements SQLDDLSt
|
||||
|
||||
private boolean orReplace = false;
|
||||
private boolean force = false;
|
||||
protected SQLName name;
|
||||
// protected SQLName name;
|
||||
protected SQLSelect subQuery;
|
||||
protected boolean ifNotExists = false;
|
||||
|
||||
@@ -38,6 +38,8 @@ public class SQLCreateViewStatement extends SQLStatementImpl implements SQLDDLSt
|
||||
protected SQLName definer;
|
||||
protected String sqlSecurity;
|
||||
|
||||
protected SQLExprTableSource tableSource;
|
||||
|
||||
protected final List<Column> columns = new ArrayList<Column>();
|
||||
|
||||
private Level with;
|
||||
@@ -61,11 +63,26 @@ public class SQLCreateViewStatement extends SQLStatementImpl implements SQLDDLSt
|
||||
}
|
||||
|
||||
public SQLName getName() {
|
||||
return name;
|
||||
if (tableSource == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (SQLName) tableSource.getExpr();
|
||||
}
|
||||
|
||||
public void setName(SQLName name) {
|
||||
this.name = name;
|
||||
this.setTableSource(new SQLExprTableSource(name));
|
||||
}
|
||||
|
||||
public SQLExprTableSource getTableSource() {
|
||||
return tableSource;
|
||||
}
|
||||
|
||||
public void setTableSource(SQLExprTableSource tableSource) {
|
||||
if (tableSource != null) {
|
||||
tableSource.setParent(this);
|
||||
}
|
||||
this.tableSource = tableSource;
|
||||
}
|
||||
|
||||
public Level getWith() {
|
||||
@@ -151,7 +168,7 @@ public class SQLCreateViewStatement extends SQLStatementImpl implements SQLDDLSt
|
||||
|
||||
public void output(StringBuffer buf) {
|
||||
buf.append("CREATE VIEW ");
|
||||
this.name.output(buf);
|
||||
this.getName().output(buf);
|
||||
|
||||
if (this.columns.size() > 0) {
|
||||
buf.append(" (");
|
||||
@@ -176,7 +193,7 @@ public class SQLCreateViewStatement extends SQLStatementImpl implements SQLDDLSt
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.name);
|
||||
acceptChild(visitor, this.tableSource);
|
||||
acceptChild(visitor, this.columns);
|
||||
acceptChild(visitor, this.comment);
|
||||
acceptChild(visitor, this.subQuery);
|
||||
|
||||
Reference in New Issue
Block a user