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:
@@ -100,8 +100,11 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements SQLReplaceable,
|
||||
return from;
|
||||
}
|
||||
|
||||
public void setFrom(SQLExpr from) {
|
||||
this.from = from;
|
||||
public void setFrom(SQLExpr x) {
|
||||
if (x != null) {
|
||||
x.setParent(this);
|
||||
}
|
||||
this.from = x;
|
||||
}
|
||||
|
||||
public List<SQLExpr> getParameters() {
|
||||
@@ -138,6 +141,9 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements SQLReplaceable,
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.owner);
|
||||
acceptChild(visitor, this.parameters);
|
||||
acceptChild(visitor, this.from);
|
||||
acceptChild(visitor, this.using);
|
||||
acceptChild(visitor, this._for);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
@@ -158,6 +164,9 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements SQLReplaceable,
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.owner);
|
||||
acceptChild(visitor, this.parameters);
|
||||
acceptChild(visitor, this.from);
|
||||
acceptChild(visitor, this.using);
|
||||
acceptChild(visitor, this._for);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
@@ -215,6 +224,7 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements SQLReplaceable,
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < parameters.size(); ++i) {
|
||||
if (parameters.get(i) == expr) {
|
||||
parameters.set(i, target);
|
||||
@@ -222,6 +232,22 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements SQLReplaceable,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (from == expr) {
|
||||
setFrom(target);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (using == expr) {
|
||||
setUsing(target);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_for == expr) {
|
||||
setFor(target);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -278,11 +304,11 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements SQLReplaceable,
|
||||
return using;
|
||||
}
|
||||
|
||||
public void setUsing(SQLExpr using) {
|
||||
if (using != null) {
|
||||
using.setParent(this);
|
||||
public void setUsing(SQLExpr x) {
|
||||
if (x != null) {
|
||||
x.setParent(this);
|
||||
}
|
||||
this.using = using;
|
||||
this.using = x;
|
||||
}
|
||||
|
||||
public SQLExpr getFor() {
|
||||
|
||||
Reference in New Issue
Block a user