refactor sql parser.

This commit is contained in:
wenshao
2017-08-29 17:10:26 +08:00
parent 2b164c377b
commit 718500cf59
24 changed files with 235 additions and 282 deletions
@@ -380,7 +380,7 @@ public class SQLColumnDefinition extends SQLObjectImpl implements SQLTableElemen
SQLIdentifierExpr identExpr = (SQLIdentifierExpr) this.name;
String columnName = identExpr.getName();
columnName = SQLUtils.normalize(columnName, dbType);
identExpr.setName(columnName);
this.setName(columnName);
}
}
@@ -584,7 +584,7 @@ public class SQLCreateTableStatement extends SQLStatementImpl implements SQLDDLS
SQLIdentifierExpr identExpr = (SQLIdentifierExpr) name;
String tableName = identExpr.getName();
tableName = SQLUtils.normalize(tableName, dbType);
identExpr.setName(tableName);
setName(tableName);
}
for (SQLTableElement element : this.tableElementList) {
@@ -60,6 +60,10 @@ public class SQLExprTableSource extends SQLTableSourceImpl {
this.expr = expr;
}
public void setExpr(String name) {
this.setExpr(new SQLIdentifierExpr(name));
}
public SQLName getName() {
if (expr instanceof SQLName) {
return (SQLName) expr;
@@ -98,7 +98,7 @@ public class SQLUnique extends SQLConstraintImpl implements SQLUniqueConstraint,
SQLIdentifierExpr identExpr = (SQLIdentifierExpr) column;
String columnName = identExpr.getName();
columnName = SQLUtils.normalize(columnName, dbType);
identExpr.setName(columnName);
item.setExpr(new SQLIdentifierExpr(columnName));
}
}
}