Package com.ibatis.sqlmap.engine.mapping.parameter

Examples of com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap


    this.resource = resource;
  }

  public CacheKey getCacheKey(RequestScope request, Object parameterObject) {
    Sql sql = request.getSql();
    ParameterMap pmap = sql.getParameterMap(request, parameterObject);
    CacheKey cacheKey = pmap.getCacheKey(request, parameterObject);
    cacheKey.update(id);
    cacheKey.update(baseCacheKey);
    cacheKey.update(sql.getSql(request, parameterObject)); //Fixes bug 953001
    return cacheKey;
  }
View Full Code Here


      parameterObject = validateParameter(parameterObject);

      Sql sql = getSql();

      errorContext.setMoreInfo("Check the parameter map.");
      ParameterMap parameterMap = sql.getParameterMap(request, parameterObject);

      errorContext.setMoreInfo("Check the result map.");
      ResultMap resultMap = sql.getResultMap(request, parameterObject);

      request.setResultMap(resultMap);
      request.setParameterMap(parameterMap);

      int rows = 0;

      errorContext.setMoreInfo("Check the parameter map.");
      Object[] parameters = parameterMap.getParameterObjectValues(request, parameterObject);

      errorContext.setMoreInfo("Check the SQL statement.");
      String sqlString = sql.getSql(request, parameterObject);

      errorContext.setActivity("executing mapped statement");
View Full Code Here

      parameterObject = validateParameter(parameterObject);

      Sql sql = getSql();

      errorContext.setMoreInfo("Check the parameter map.");
      ParameterMap parameterMap = sql.getParameterMap(request, parameterObject);

      errorContext.setMoreInfo("Check the result map.");
      ResultMap resultMap = sql.getResultMap(request, parameterObject);

      request.setResultMap(resultMap);
      request.setParameterMap(parameterMap);

      errorContext.setMoreInfo("Check the parameter map.");
      Object[] parameters = parameterMap.getParameterObjectValues(request, parameterObject);

      errorContext.setMoreInfo("Check the SQL statement.");
      String sqlString = sql.getSql(request, parameterObject);

      errorContext.setActivity("executing mapped statement");
View Full Code Here

   *
   * @param id - the ID
   * @return - the parameter map
   */
  public ParameterMap getParameterMap(String id) {
    ParameterMap map = (ParameterMap) parameterMaps.get(id);
    if (map == null) {
      throw new SqlMapException("There is no parameter map named " + id + " in this SqlMap.");
    }
    return map;
  }
View Full Code Here

  private void applyInlineParameterMap(GeneralStatement statement, String sqlStatement) {
    String newSql = sqlStatement;

    vars.errorCtx.setActivity("building an inline parameter map");

    ParameterMap parameterMap = statement.getParameterMap();

    vars.errorCtx.setMoreInfo("Check the inline parameters.");
    if (parameterMap == null) {

      BasicParameterMap map;
View Full Code Here

   * @param properties
   */
  public void initialize(Map properties) {
    Object map = properties.get("map");
    if (map instanceof ParameterMap) {
      ParameterMap parameterMap = (ParameterMap) map;
      if (parameterMap != null) {
        ParameterMapping[] parameterMappings = parameterMap.getParameterMappings();
        String[] parameterPropNames = new String[parameterMappings.length];
        for (int i = 0; i < parameterPropNames.length; i++) {
          parameterPropNames[i] = parameterMappings[i].getPropertyName();
        }
        parameterPlan = AccessPlanFactory.getAccessPlan(parameterMap.getParameterClass(), parameterPropNames);

        // OUTPUT PARAMS
        List outParamList = new ArrayList();
        for (int i = 0; i < parameterPropNames.length; i++) {
          if (parameterMappings[i].isOutputAllowed()) {
            outParamList.add(parameterMappings[i].getPropertyName());
          }
        }
        String[] outParams = (String[]) outParamList.toArray(new String[outParamList.size()]);
        outParamPlan = AccessPlanFactory.getAccessPlan(parameterMap.getParameterClass(), outParams);
      }

    } else if (map instanceof ResultMap) {
      ResultMap resultMap = (ResultMap) map;
      if (resultMap != null) {
View Full Code Here

    try {
      errorContext.setMoreInfo("Check the SQL Statement (preparation failed).");
      cs = conn.prepareCall(sql);

      ParameterMap parameterMap = request.getParameterMap();

      ParameterMapping[] mappings = parameterMap.getParameterMappings();

      errorContext.setMoreInfo("Check the output parameters (register output parameters failed).");
      registerOutputParameters(cs, mappings);

      errorContext.setMoreInfo("Check the parameters (set parameters failed).");
      parameterMap.setParameters(request, cs, parameters);

      errorContext.setMoreInfo("Check the statement (update procedure failed).");

      cs.execute();
      rows = cs.getUpdateCount();
View Full Code Here

    try {
      errorContext.setMoreInfo("Check the SQL Statement (preparation failed).");
      cs = conn.prepareCall(sql);

      ParameterMap parameterMap = request.getParameterMap();

      ParameterMapping[] mappings = parameterMap.getParameterMappings();

      errorContext.setMoreInfo("Check the output parameters (register output parameters failed).");
      registerOutputParameters(cs, mappings);

      errorContext.setMoreInfo("Check the parameters (set parameters failed).");
      parameterMap.setParameters(request, cs, parameters);

      errorContext.setMoreInfo("Check the statement (update procedure failed).");

      cs.execute();
      rs = getFirstResultSet(cs);
View Full Code Here

    }
    return sql;
  }

  public ParameterMap getParameterMap(RequestScope request, Object parameterObject) {
    ParameterMap map = request.getDynamicParameterMap();
    if (map == null) {
      process(request, parameterObject);
      map = request.getDynamicParameterMap();
    }
    return map;
View Full Code Here

    try {
      errorContext.setMoreInfo("Check the SQL Statement (preparation failed).");
      cs = conn.prepareCall(sql);

      ParameterMap parameterMap = request.getParameterMap();

      ParameterMapping[] mappings = parameterMap.getParameterMappings();

      errorContext.setMoreInfo("Check the output parameters (register output parameters failed).");
      registerOutputParameters(cs, mappings);

      errorContext.setMoreInfo("Check the parameters (set parameters failed).");
      parameterMap.setParameters(request, cs, parameters);

      errorContext.setMoreInfo("Check the statement (update procedure failed).");

      cs.execute();
      rows = cs.getUpdateCount();
View Full Code Here

TOP

Related Classes of com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.