improved sql parser. bug fixed for oracle extract function. issue #1481

This commit is contained in:
wenshao
2016-11-25 17:28:26 +08:00
parent 8b8a3f9e50
commit 51a9a616dc
13 changed files with 93 additions and 210 deletions
@@ -31,6 +31,8 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements Serializable {
private SQLExpr owner;
private final List<SQLExpr> parameters = new ArrayList<SQLExpr>();
private SQLExpr from;
public SQLMethodInvokeExpr(){
}
@@ -64,6 +66,14 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements Serializable {
this.owner = owner;
}
public SQLExpr getFrom() {
return from;
}
public void setFrom(SQLExpr from) {
this.from = from;
}
public List<SQLExpr> getParameters() {
return this.parameters;
}
@@ -113,48 +123,25 @@ public class SQLMethodInvokeExpr extends SQLExprImpl implements Serializable {
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((methodName == null) ? 0 : methodName.hashCode());
result = prime * result + ((owner == null) ? 0 : owner.hashCode());
result = prime * result + ((parameters == null) ? 0 : parameters.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SQLMethodInvokeExpr that = (SQLMethodInvokeExpr) o;
if (methodName != null ? !methodName.equals(that.methodName) : that.methodName != null) return false;
if (owner != null ? !owner.equals(that.owner) : that.owner != null) return false;
if (parameters != null ? !parameters.equals(that.parameters) : that.parameters != null) return false;
return from != null ? from.equals(that.from) : that.from == null;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
SQLMethodInvokeExpr other = (SQLMethodInvokeExpr) obj;
if (methodName == null) {
if (other.methodName != null) {
return false;
}
} else if (!methodName.equals(other.methodName)) {
return false;
}
if (owner == null) {
if (other.owner != null) {
return false;
}
} else if (!owner.equals(other.owner)) {
return false;
}
if (parameters == null) {
if (other.parameters != null) {
return false;
}
} else if (!parameters.equals(other.parameters)) {
return false;
}
return true;
public int hashCode() {
int result = methodName != null ? methodName.hashCode() : 0;
result = 31 * result + (owner != null ? owner.hashCode() : 0);
result = 31 * result + (parameters != null ? parameters.hashCode() : 0);
result = 31 * result + (from != null ? from.hashCode() : 0);
return result;
}
}