コード例 #1
0
  private boolean regiesterOut(int index) throws SQLException {
    EqlParamPlaceholder.InOut inOut = eqlRun.getPlaceHolders()[index].getInOut();
    if (EqlUtils.isProcedure(eqlRun.getSqlType()) && inOut != EqlParamPlaceholder.InOut.IN)
      ((CallableStatement) ps).registerOutParameter(index + 1, Types.VARCHAR);

    return inOut == EqlParamPlaceholder.InOut.OUT;
  }
コード例 #2
0
  private Object getParamByIndex(int index) {
    EqlParamPlaceholder[] placeHolders = eqlRun.getPlaceHolders();
    if (index < placeHolders.length
        && EqlUtils.isProcedure(eqlRun.getSqlType())
        && placeHolders[index].getInOut() == EqlParamPlaceholder.InOut.OUT) return null;

    Object[] params = eqlRun.getParams();
    if (params != null && index < params.length) return params[index];

    throw new EqlExecuteException("[" + eqlRun.getSqlId() + "]执行过程中缺少参数");
  }
コード例 #3
0
  private Object findParamByName(int index) {
    String varName = eqlRun.getPlaceHolders()[index].getPlaceholder();

    ExpressionEvaluator evaluator = eqlRun.getEqlConfig().getExpressionEvaluator();

    Object property = evaluator.eval(varName, eqlRun);

    if (property != null) return property;

    String propertyName = EqlUtils.convertUnderscoreNameToPropertyName(varName);
    return Objects.equal(propertyName, varName) ? property : evaluator.eval(propertyName, eqlRun);
  }
コード例 #4
0
 private Object findParamBySeq(int index) {
   return getParamByIndex(eqlRun.getPlaceHolders()[index - 1].getSeq() - 1);
 }