improved sql parser.

This commit is contained in:
wenshao
2017-09-17 17:11:26 +08:00
parent b54a987cc8
commit 3c98a1eee5
23 changed files with 955 additions and 31 deletions
@@ -26,7 +26,7 @@ import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
import com.alibaba.druid.util.JdbcConstants;
public class SQLColumnDefinition extends SQLObjectImpl implements SQLTableElement, SQLObjectWithDataType {
public class SQLColumnDefinition extends SQLObjectImpl implements SQLTableElement, SQLObjectWithDataType, SQLReplaceable {
protected String dbType;
protected SQLName name;
@@ -250,6 +250,21 @@ public class SQLColumnDefinition extends SQLObjectImpl implements SQLTableElemen
this.storage = storage;
}
@Override
public boolean replace(SQLExpr expr, SQLExpr target) {
if (defaultExpr == expr) {
setDefaultExpr(target);
return true;
}
if (name == expr) {
setName((SQLName) target);
return true;
}
return false;
}
public static class Identity extends SQLObjectImpl {
private Integer seed;