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

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


      parameterObject = validateParameter(parameterObject);

      Sql sql = getSql();

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

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

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

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

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

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


    this.resource = resource;
  }

  public CacheKey getCacheKey(StatementScope statementScope, Object parameterObject) {
    Sql sql = statementScope.getSql();
    ParameterMap pmap = sql.getParameterMap(statementScope, parameterObject);
    CacheKey cacheKey = pmap.getCacheKey(statementScope, parameterObject);
    cacheKey.update(id);
    cacheKey.update(baseCacheKey);
    cacheKey.update(sql.getSql(statementScope, parameterObject)); //Fixes bug 953001
    return cacheKey;
  }
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

   *
   * @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

    int rows = 0;
    try {
      errorContext.setMoreInfo("Check the SQL Statement (preparation failed).");
      cs = prepareCall(statementScope.getSession(), conn, sql);
      setStatementTimeout(statementScope.getStatement(), cs);
      ParameterMap parameterMap = statementScope.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(statementScope, cs, parameters);
      errorContext.setMoreInfo("Check the statement (update procedure failed).");
      cs.execute();
      rows = cs.getUpdateCount();
      errorContext.setMoreInfo("Check the output parameters (retrieval of output parameters failed).");
      retrieveOutputParameters(statementScope, cs, mappings, parameters, null);
View Full Code Here

      setStatementTimeout(statementScope.getStatement(), cs);
      Integer fetchSize = statementScope.getStatement().getFetchSize();
      if (fetchSize != null) {
        cs.setFetchSize(fetchSize.intValue());
      }
      ParameterMap parameterMap = statementScope.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(statementScope, cs, parameters);
      errorContext.setMoreInfo("Check the statement (update procedure failed).");
      cs.execute();
      errorContext.setMoreInfo("Check the results (failed to retrieve results).");

      // Begin ResultSet Handling
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

    int rows = 0;
    try {
      errorContext.setMoreInfo("Check the SQL Statement (preparation failed).");
      cs = prepareCall(request.getSession(), conn, sql);
      setStatementTimeout(request.getStatement(), cs);
      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();
      errorContext.setMoreInfo("Check the output parameters (retrieval of output parameters failed).");
      retrieveOutputParameters(request, cs, mappings, parameters, null);
View Full Code Here

      setStatementTimeout(request.getStatement(), cs);
      Integer fetchSize = request.getStatement().getFetchSize();
      if (fetchSize != null) {
        cs.setFetchSize(fetchSize.intValue());
      }
      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();
      errorContext.setMoreInfo("Check the results (failed to retrieve results).");

      // Begin ResultSet Handling
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

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.