improved SchemaStatVisitor, support function condition

This commit is contained in:
高铁
2016-01-31 23:36:45 +08:00
parent 43e9209960
commit cdeec1f73c
9 changed files with 70 additions and 5 deletions
@@ -383,6 +383,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
case GreaterThan:
case GreaterThanOrEqual:
case LessThan:
case LessThanOrGreater:
case LessThanOrEqual:
case LessThanOrEqualOrGreaterThan:
case Like:
@@ -459,6 +460,14 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
if (aliasMap == null) {
return null;
}
if (expr instanceof SQLMethodInvokeExpr) {
SQLMethodInvokeExpr methodInvokeExp = (SQLMethodInvokeExpr) expr;
if (methodInvokeExp.getParameters().size() == 1) {
SQLExpr firstExpr = methodInvokeExp.getParameters().get(0);
return getColumn(firstExpr);
}
}
if (expr instanceof SQLPropertyExpr) {
SQLExpr owner = ((SQLPropertyExpr) expr).getOwner();