Example usage for org.springframework.jdbc.core.namedparam SqlParameterSource getValue

List of usage examples for org.springframework.jdbc.core.namedparam SqlParameterSource getValue

Introduction

In this page you can find the example usage for org.springframework.jdbc.core.namedparam SqlParameterSource getValue.

Prototype

@Nullable
Object getValue(String paramName) throws IllegalArgumentException;

Source Link

Document

Return the parameter value for the requested named parameter.

Usage

From source file:com.google.enterprise.connector.sharepoint.dao.SimpleSharePointDAO.java

/**
 * Executes a single update query. Used after the fall back from batch mode
 *
 * @param query query to be executed specified as {@link Query}
 * @param param {@link SqlParameterSource} query parameter to construct the
 *          SQL query// ww  w  . j  a  v a  2s .c o m
   * @return status of the query execution (=no. of rows updated)
 * @throws SharepointException
 */
public int update(Query query, SqlParameterSource param) throws SharepointException {
    int count = -1;
    try {
        count = getSimpleJdbcTemplate().update(getSqlQuery(query), param);
    } catch (DataIntegrityViolationException e) {
        LOGGER.log(Level.FINE,
                "entry already exists in user data store for the group name ["
                        + param.getValue(SPConstants.GROUP_NAME) + "], and user name ["
                        + param.getValue(SPConstants.USER_NAME) + "]");
    } catch (Throwable e) {
        throw new SharepointException(
                "Failed to add the record for parameter [ " + param.getValue(SPConstants.GROUP_NAME)
                        + "], user name [" + param.getValue(SPConstants.USER_NAME) + "]",
                e);
    }
    return count;
}

From source file:com.opengamma.masterdb.batch.DbBatchWriter.java

private long getFunctionId(SqlParameterSource args) {
    return (Long) args.getValue("function_unique_id");
}

From source file:com.opengamma.masterdb.batch.DbBatchWriter.java

private long getId(SqlParameterSource args) {
    return (Long) args.getValue("id");
}

From source file:com.opengamma.masterdb.batch.DbBatchWriter.java

private SqlParameterSource convertSuccessToFailure(SqlParameterSource successArgs) {
    return getFailureArgs((Long) successArgs.getValue("id"), (Long) successArgs.getValue("run_id"),
            DbDateUtils.fromSqlTimestamp((Timestamp) successArgs.getValue("eval_instant")),
            (Long) successArgs.getValue("calculation_configuration_id"),
            (Long) successArgs.getValue("computation_target_id"),
            (Long) successArgs.getValue("value_specification_id"), (Long) getFunctionId(successArgs),
            (Long) successArgs.getValue("compute_node_id"), (String) successArgs.getValue("name"));
}