Package org.g4studio.core.orm.xibatis.sqlmap.client

Examples of org.g4studio.core.orm.xibatis.sqlmap.client.SqlMapException


  public void putTypeAlias(String alias, String value) {
    String key = null;
    if (alias != null)
      key = alias.toLowerCase();
    if (typeAliases.containsKey(key) && !typeAliases.get(key).equals(value)) {
      throw new SqlMapException("Error in XmlSqlMapClientBuilder.  Alias name conflict occurred.  The alias '"
          + key + "' is already mapped to the value '" + typeAliases.get(alias) + "'.");
    }
    typeAliases.put(key, value);
  }
View Full Code Here


        Context ctx = (Context) initCtx.lookup((String) properties.get("DBInitialContext"));
        dataSource = (DataSource) ctx.lookup((String) properties.get("DBLookup"));
      }

    } catch (NamingException e) {
      throw new SqlMapException("There was an error configuring JndiDataSourceTransactionPool. Cause: " + e, e);
    }
  }
View Full Code Here

   * @param ms
   *            - the mapped statement to add
   */
  public void addMappedStatement(MappedStatement ms) {
    if (mappedStatements.containsKey(ms.getId())) {
      throw new SqlMapException("There is already a statement named " + ms.getId() + " in this SqlMap.");
    }
    ms.setBaseCacheKey(hashCode());
    mappedStatements.put(ms.getId(), ms);
  }
View Full Code Here

   * @return - the mapped statement
   */
  public MappedStatement getMappedStatement(String id) {
    MappedStatement ms = (MappedStatement) mappedStatements.get(id);
    if (ms == null) {
      throw new SqlMapException("There is no statement named " + id + " in this SqlMap.");
    }
    return ms;
  }
View Full Code Here

   * @return - the cache model
   */
  public CacheModel getCacheModel(String id) {
    CacheModel model = (CacheModel) cacheModels.get(id);
    if (model == null) {
      throw new SqlMapException("There is no cache model named " + id + " in this SqlMap.");
    }
    return model;
  }
View Full Code Here

   * @return - the result map
   */
  public ResultMap getResultMap(String id) {
    ResultMap map = (ResultMap) resultMaps.get(id);
    if (map == null) {
      throw new SqlMapException("There is no result map named " + id + " in this SqlMap.");
    }
    return map;
  }
View Full Code Here

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

        this.javaType = null;
      } else {
        this.javaType = Resources.classForName(javaTypeName);
      }
    } catch (ClassNotFoundException e) {
      throw new SqlMapException("Error setting javaType property of ParameterMap.  Cause: " + e, e);
    }
  }
View Full Code Here

    statement.setTimeout(defaultStatementTimeout);
    if (timeout != null) {
      try {
        statement.setTimeout(timeout);
      } catch (NumberFormatException e) {
        throw new SqlMapException("Specified timeout value for statement " + statement.getId()
            + " is not a valid integer");
      }
    }
    errorContext.setMoreInfo(null);
    errorContext.setObjectId(null);
View Full Code Here

            resultClass = PROBE.getPropertyTypeForSetter(parameterClass,
                selectKeyStatement.getKeyProperty());
          }
        }
      } catch (ClassNotFoundException e) {
        throw new SqlMapException("Error.  Could not set result class.  Cause: " + e, e);
      }
      if (resultClass == null) {
        resultClass = Object.class;
      }

      // process SQL statement, including inline parameter maps
      errorContext.setMoreInfo("Check the select key SQL statement.");
      Sql sql = processor.getSql();
      setSqlForStatement(selectKeyStatement, sql);
      ResultMap resultMap;
      resultMap = new AutoResultMap(client.getDelegate(), false);
      resultMap.setId(selectKeyStatement.getId() + "-AutoResultMap");
      resultMap.setResultClass(resultClass);
      resultMap.setResource(selectKeyStatement.getResource());
      selectKeyStatement.setResultMap(resultMap);
      errorContext.setMoreInfo(null);
      insertStatement.setSelectKeyStatement(selectKeyStatement);
    } else {
      throw new SqlMapException("You cant set a select key statement on statement named " + rootStatement.getId()
          + " because it is not an InsertStatement.");
    }
  }
View Full Code Here

TOP

Related Classes of org.g4studio.core.orm.xibatis.sqlmap.client.SqlMapException

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.