Package com.opengamma.util.db

Examples of com.opengamma.util.db.DbMapSqlParameterSource.addValue()


    final Long runId = extractOid(batchId);
    final DbMapSqlParameterSource args = new DbMapSqlParameterSource();
    args.addValue("run_id", runId);
    if (pagingRequest != null) {
      args.addValue("paging_offset", pagingRequest.getFirstItem());
      args.addValue("paging_fetch", pagingRequest.getPagingSize());
    }
   
    final String[] sql = {getElSqlBundle().getSql("GetBatchValues", args), getElSqlBundle().getSql("BatchValuesCount", args)};
    return searchWithPaging(pagingRequest, sql, args, new BatchValuesExtractor());
  }
View Full Code Here


        selectSql = selectComputationTargetSpecificationSql;
      }

      final DbMapSqlParameterSource selectArgs = new DbMapSqlParameterSource();
      for (String attribName : attribs.keySet()) {
        selectArgs.addValue(attribName, attribs.get(attribName));
      }
      List<Map<String, Object>> results = getJdbcTemplate().queryForList(selectSql, selectArgs);
      if (results.isEmpty()) {
        // select avoids creating unecessary id, but id may still not be used
        final long id = nextId(RSK_SEQUENCE_NAME);
View Full Code Here

      if (results.isEmpty()) {
        // select avoids creating unecessary id, but id may still not be used
        final long id = nextId(RSK_SEQUENCE_NAME);
        final DbMapSqlParameterSource insertArgs = new DbMapSqlParameterSource().addValue("id", id);
        for (String attribName : attribs.keySet()) {
          insertArgs.addValue(attribName, attribs.get(attribName));
        }
        insertArgsList.add(insertArgs);
        //
        for (ComputationTargetSpecification obj : attribsToObjects.getValue()) {
          cache.put(obj, id);
View Full Code Here

    Map<T, Long> cache = newHashMap();
    for (Map.Entry<Map<String, Object>, Collection<T>> attribsToObjects : data.entrySet()) {
      Map<String, Object> attribs = attribsToObjects.getKey();
      final DbMapSqlParameterSource selectArgs = new DbMapSqlParameterSource();
      for (String attribName : attribs.keySet()) {
        selectArgs.addValue(attribName, attribs.get(attribName));
      }
      List<Map<String, Object>> results = getJdbcTemplate().queryForList(selectSql, selectArgs);
      if (results.isEmpty()) {
        // select avoids creating unecessary id, but id may still not be used
        final long id = nextId(pkSequenceName);
View Full Code Here

      if (results.isEmpty()) {
        // select avoids creating unecessary id, but id may still not be used
        final long id = nextId(pkSequenceName);
        final DbMapSqlParameterSource insertArgs = new DbMapSqlParameterSource().addValue("id", id);
        for (String attribName : attribs.keySet()) {
          insertArgs.addValue(attribName, attribs.get(attribName));
        }
        insertArgsList.add(insertArgs);
        //
        for (T obj : attribsToObjects.getValue()) {
          cache.put(obj, id);
View Full Code Here

  }

  protected Map<String, Object> getAttributes(Map<String, Object> attribs, String selectSql) {
    final DbMapSqlParameterSource selectArgs = new DbMapSqlParameterSource();
    for (String paramName : attribs.keySet()) {
      selectArgs.addValue(paramName, attribs.get(paramName));
    }
    List<Map<String, Object>> results = getJdbcTemplate().queryForList(selectSql, selectArgs);
    if (results.isEmpty()) {
      return null;
    } else if (results.size() == 1) {
View Full Code Here

    return (Long) args.getValue("id");
  }

  private DbMapSqlParameterSource getFailureReasonArgs(long failureReasonId, long failureId, long computeFailureId) {
    final DbMapSqlParameterSource args = new DbMapSqlParameterSource();
    args.addValue("id", failureReasonId);
    args.addValue("rsk_failure_id", failureId);
    args.addValue("compute_failure_id", computeFailureId);
    return args;
  }
View Full Code Here

  }

  private DbMapSqlParameterSource getFailureReasonArgs(long failureReasonId, long failureId, long computeFailureId) {
    final DbMapSqlParameterSource args = new DbMapSqlParameterSource();
    args.addValue("id", failureReasonId);
    args.addValue("rsk_failure_id", failureId);
    args.addValue("compute_failure_id", computeFailureId);
    return args;
  }

  private SqlParameterSource getSuccessArgs(long successId, long riskRunId, Instant evalInstant, long calcConfId,
View Full Code Here

  private DbMapSqlParameterSource getFailureReasonArgs(long failureReasonId, long failureId, long computeFailureId) {
    final DbMapSqlParameterSource args = new DbMapSqlParameterSource();
    args.addValue("id", failureReasonId);
    args.addValue("rsk_failure_id", failureId);
    args.addValue("compute_failure_id", computeFailureId);
    return args;
  }

  private SqlParameterSource getSuccessArgs(long successId, long riskRunId, Instant evalInstant, long calcConfId,
      long computationTargetId, long valueSpecificationId, long functionUniqueId, long computeNodeId, String valueName, Double doubleValue) {
View Full Code Here

  }

  private SqlParameterSource getSuccessArgs(long successId, long riskRunId, Instant evalInstant, long calcConfId,
      long computationTargetId, long valueSpecificationId, long functionUniqueId, long computeNodeId, String valueName, Double doubleValue) {
    DbMapSqlParameterSource args = new DbMapSqlParameterSource();
    args.addValue("id", successId);
    args.addValue("calculation_configuration_id", calcConfId);
    args.addValue("name", valueName);
    args.addValue("value_specification_id", valueSpecificationId);
    args.addValue("function_unique_id", functionUniqueId);
    args.addValue("computation_target_id", computationTargetId);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.