mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -33,6 +33,21 @@ public class SQLDeclareItem extends SQLObjectImpl {
|
||||
|
||||
protected List<SQLTableElement> tableElementList = new ArrayList<SQLTableElement>();
|
||||
|
||||
public SQLDeclareItem() {
|
||||
|
||||
}
|
||||
|
||||
public SQLDeclareItem(SQLExpr name, SQLDataType dataType) {
|
||||
this.setName(name);
|
||||
this.setDataType(dataType);
|
||||
}
|
||||
|
||||
public SQLDeclareItem(SQLExpr name, SQLDataType dataType, SQLExpr value) {
|
||||
this.setName(name);
|
||||
this.setDataType(dataType);
|
||||
this.setValue(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
@@ -49,6 +64,9 @@ public class SQLDeclareItem extends SQLObjectImpl {
|
||||
}
|
||||
|
||||
public void setName(SQLExpr name) {
|
||||
if (name != null) {
|
||||
name.setParent(this);
|
||||
}
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@@ -57,6 +75,9 @@ public class SQLDeclareItem extends SQLObjectImpl {
|
||||
}
|
||||
|
||||
public void setDataType(SQLDataType dataType) {
|
||||
if (dataType != null) {
|
||||
dataType.setParent(this);
|
||||
}
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
@@ -65,6 +86,9 @@ public class SQLDeclareItem extends SQLObjectImpl {
|
||||
}
|
||||
|
||||
public void setValue(SQLExpr value) {
|
||||
if (value != null) {
|
||||
value.setParent(this);
|
||||
}
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user