mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add setParent
This commit is contained in:
@@ -41,8 +41,8 @@ public class SQLBinaryOpExpr extends SQLExprImpl implements Serializable {
|
||||
|
||||
public SQLBinaryOpExpr(SQLExpr left, SQLExpr right, SQLBinaryOperator operator){
|
||||
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
setLeft(left);
|
||||
setRight(right);
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@ public class SQLCaseExpr extends SQLExprImpl implements Serializable {
|
||||
}
|
||||
|
||||
public void setValueExpr(SQLExpr valueExpr) {
|
||||
if (valueExpr != null) {
|
||||
valueExpr.setParent(this);
|
||||
}
|
||||
this.valueExpr = valueExpr;
|
||||
}
|
||||
|
||||
@@ -71,6 +74,9 @@ public class SQLCaseExpr extends SQLExprImpl implements Serializable {
|
||||
}
|
||||
|
||||
public void setElseExpr(SQLExpr elseExpr) {
|
||||
if (elseExpr != null) {
|
||||
elseExpr.setParent(this);
|
||||
}
|
||||
this.elseExpr = elseExpr;
|
||||
}
|
||||
|
||||
@@ -78,6 +84,13 @@ public class SQLCaseExpr extends SQLExprImpl implements Serializable {
|
||||
return this.items;
|
||||
}
|
||||
|
||||
public void addItem(Item item) {
|
||||
if (item != null) {
|
||||
item.setParent(this);
|
||||
this.items.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.valueExpr);
|
||||
@@ -99,8 +112,8 @@ public class SQLCaseExpr extends SQLExprImpl implements Serializable {
|
||||
|
||||
public Item(SQLExpr conditionExpr, SQLExpr valueExpr){
|
||||
|
||||
this.conditionExpr = conditionExpr;
|
||||
this.valueExpr = valueExpr;
|
||||
setConditionExpr(conditionExpr);
|
||||
setValueExpr(valueExpr);
|
||||
}
|
||||
|
||||
public SQLExpr getConditionExpr() {
|
||||
@@ -108,6 +121,9 @@ public class SQLCaseExpr extends SQLExprImpl implements Serializable {
|
||||
}
|
||||
|
||||
public void setConditionExpr(SQLExpr conditionExpr) {
|
||||
if (conditionExpr != null) {
|
||||
conditionExpr.setParent(this);
|
||||
}
|
||||
this.conditionExpr = conditionExpr;
|
||||
}
|
||||
|
||||
@@ -116,6 +132,9 @@ public class SQLCaseExpr extends SQLExprImpl implements Serializable {
|
||||
}
|
||||
|
||||
public void setValueExpr(SQLExpr valueExpr) {
|
||||
if (valueExpr != null) {
|
||||
valueExpr.setParent(this);
|
||||
}
|
||||
this.valueExpr = valueExpr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user