use of com.actiontech.dble.route.ProcedureParameter in project dble by actiontech.
the class AbstractRouteStrategy method parseProcedureForCall.
private void parseProcedureForCall(Procedure procedure, String query, SQLCallStatement statement) {
SQLCallStatement sqlCallStatement = statement;
procedure.setName(sqlCallStatement.getProcedureName().getSimpleName());
List<SQLExpr> parameterList = sqlCallStatement.getParameters();
for (int i1 = 0; i1 < parameterList.size(); i1++) {
SQLExpr sqlExpr = parameterList.get(i1);
String pName = sqlExpr.toString();
ProcedureParameter parameter = new ProcedureParameter();
parameter.setIndex(i1 + 1);
parameter.setName(pName);
parameter.setParameterType(ProcedureParameter.IN);
if (pName.startsWith("@")) {
procedure.getParameterMap().put(pName, parameter);
} else {
procedure.getParameterMap().put(String.valueOf(i1 + 1), parameter);
}
}
procedure.setCallSql(query);
}
Aggregations