Package jodd.util.collection

Examples of jodd.util.collection.IntArrayList


    }
  }

  public void setAsciiStream(String param, InputStream stream, int length) {
    init();
    IntArrayList positions = query.getNamedParameterIndices(param);
    try {
      for (int i = 0; i < positions.size(); i++) {
        preparedStatement.setAsciiStream(positions.get(i), stream, length);
      }
    } catch (SQLException sex) {
      throwSetParamError(param, sex);
    }
  }
View Full Code Here


    }
  }

  public void setCharacterStream(String param, Reader reader, int length) {
    init();
    IntArrayList positions = query.getNamedParameterIndices(param);
    try {
      for (int i = 0; i < positions.size(); i++) {
        preparedStatement.setCharacterStream(positions.get(i), reader, length);
      }
    } catch (SQLException sex) {
      throwSetParamError(param, sex);
    }
  }
View Full Code Here

   * This method is like the method <code>setObject</code>
   * above, except that it assumes a scale of zero.
   */
  public void setObject(String param, Object object, int targetSqlType) {
    init();
    IntArrayList positions = query.getNamedParameterIndices(param);
    try {
      for (int i = 0; i < positions.size(); i++) {
        preparedStatement.setObject(positions.get(i), object, targetSqlType);
      }
    } catch (SQLException sex) {
      throwSetParamError(param, sex);
    }
  }
View Full Code Here

   * This method is like the method <code>setObject</code>
   * above, except that it assumes a scale of zero.
   */
    void setObject(String param, Object object, int targetSqlType, int scale) {
    init();
    IntArrayList positions = query.getNamedParameterIndices(param);
    try {
      for (int i = 0; i < positions.size(); i++) {
        preparedStatement.setObject(positions.get(i), object, targetSqlType, scale);
      }
    } catch (SQLException sex) {
      throwSetParamError(param, sex);
    }
  }
View Full Code Here

  /**
   * @see #setObject(String, Object, Class, int)
   */
  public void setObject(String param, Object value, Class<? extends SqlType> sqlTypeClass, int dbSqlType) {
    init();
    IntArrayList positions = query.getNamedParameterIndices(param);
    for (int i = 0; i < positions.size(); i++) {
      setObject(positions.get(i), value, sqlTypeClass, dbSqlType);
    }
  }
View Full Code Here

  // ---------------------------------------------------------------- parameters

  private Map<String, IntArrayList> namedParameterLocationMap;

  private void storeNamedParameter(String name, int position) {
    IntArrayList locations = namedParameterLocationMap.get(name);
    if (locations == null) {
      locations = new IntArrayList();
      namedParameterLocationMap.put(name, locations);
    }
    locations.add(position);
  }
View Full Code Here

  IntArrayList lookupNamedParameterIndices(String name) {
    return namedParameterLocationMap.get(name);
  }

  IntArrayList getNamedParameterIndices(String name) {
    IntArrayList positions = namedParameterLocationMap.get(name);
    if (positions == null) {
      throw new DbSqlException("Named parameter not found: " + name + "\nQuery: " + sql);
    }
    return positions;
  }
View Full Code Here

    }
  }


  private void doTestSingleNamedParam(DbQueryEx dbp, String paramName, int position) {
    IntArrayList list = dbp.lookupNamedParameterIndices(paramName);
    assertEquals(1, list.size());
    assertEquals(position, list.get(0));
    assertTrue(dbp.prepared);
  }
View Full Code Here

    assertEquals(position, list.get(0));
    assertTrue(dbp.prepared);
  }

  private void doTestDoubleNamedParam(DbQueryEx dbp, String paramName, int position1, int position2) {
    IntArrayList list = dbp.lookupNamedParameterIndices(paramName);
    assertEquals(2, list.size());
    assertEquals(position1, list.get(0));
    assertEquals(position2, list.get(1));
    assertTrue(dbp.prepared);
  }
View Full Code Here

  public SignatureVisitor visitParameterType() {
    super.visitParameterType();
    visitingArgument = true;
    if (argumentsOpcodeType == null) {
      argumentsOpcodeType = new CharArrayList();
      argumentsOffset = new IntArrayList();
      argumentsTypeNames = new ArrayList<String>();

      argumentsOpcodeType.add('L');
      argumentsOffset.add(0);
      argumentsTypeNames.add(null);
View Full Code Here

TOP

Related Classes of jodd.util.collection.IntArrayList

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.