public void putPreparedStatement(
     SqlMapExecutorDelegate delegate, String sql, PreparedStatement ps) {
   if (delegate.isStatementCacheEnabled()) {
     if (!isInBatch()) {
       if (hasPreparedStatementFor(sql))
         throw new SqlMapException("Duplicate prepared statement found.  This is likely a bug.");
       preparedStatements.put(sql, ps);
     }
   }
 }
예제 #2
0
  public void setParameterMappingList(List parameterMappingList) {
    this.parameterMappings =
        (ParameterMapping[])
            parameterMappingList.toArray(new ParameterMapping[parameterMappingList.size()]);
    parameterMappingIndex.clear();
    for (int i = 0; i < parameterMappings.length; i++) {
      parameterMappingIndex.put(parameterMappings[i].getPropertyName(), new Integer(i));
    }
    Map props = new HashMap();
    props.put("map", this);

    dataExchange = delegate.getDataExchangeFactory().getDataExchangeForClass(parameterClass);
    dataExchange.initialize(props);
  }