mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve sql parser
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.ast.expr;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.SQLExprImpl;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
@@ -58,8 +57,8 @@ public class SQLIdentifierExpr extends SQLExprImpl implements SQLName {
|
||||
this.lowerName = lowerName;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return SQLUtils.toSQLString(this);
|
||||
public void output(StringBuffer buf) {
|
||||
buf.append(this.name);
|
||||
}
|
||||
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
|
||||
@@ -21,14 +21,27 @@ import java.util.List;
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLStatementImpl;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLVariantRefExpr;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class SQLCallStatement extends SQLStatementImpl {
|
||||
|
||||
private boolean brace = false;
|
||||
|
||||
private SQLVariantRefExpr outParameter;
|
||||
|
||||
private SQLName procedureName;
|
||||
|
||||
private final List<SQLExpr> parameters = new ArrayList<SQLExpr>();
|
||||
|
||||
public SQLVariantRefExpr getOutParameter() {
|
||||
return outParameter;
|
||||
}
|
||||
|
||||
public void setOutParameter(SQLVariantRefExpr outParameter) {
|
||||
this.outParameter = outParameter;
|
||||
}
|
||||
|
||||
public SQLName getProcedureName() {
|
||||
return procedureName;
|
||||
}
|
||||
@@ -41,11 +54,21 @@ public class SQLCallStatement extends SQLStatementImpl {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public boolean isBrace() {
|
||||
return brace;
|
||||
}
|
||||
|
||||
public void setBrace(boolean brace) {
|
||||
this.brace = brace;
|
||||
}
|
||||
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.outParameter);
|
||||
acceptChild(visitor, this.procedureName);
|
||||
acceptChild(visitor, this.parameters);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user