BATCH-1498: fixed by adding params in jump to query execution

This commit is contained in:
dsyer
2010-01-31 18:27:27 +00:00
parent 9f8e73f627
commit a699c5c4bd
7 changed files with 58 additions and 35 deletions

View File

@@ -222,11 +222,19 @@ public class JdbcPagingItemReader<T> extends AbstractPagingItemReader<T> impleme
logger.debug("SQL used for jumping: [" + jumpToItemSql + "]");
}
startAfterValue = simpleJdbcTemplate.getJdbcOperations().queryForObject(jumpToItemSql, new RowMapper() {
RowMapper startMapper = new RowMapper() {
public Object mapRow(ResultSet rs, int i) throws SQLException {
return rs.getObject(1);
}
});
};
if (this.queryProvider.isUsingNamedParameters()) {
startAfterValue = simpleJdbcTemplate.getNamedParameterJdbcOperations().queryForObject(jumpToItemSql,
getParameterMap(parameterValues, startAfterValue), startMapper);
}
else {
startAfterValue = simpleJdbcTemplate.getJdbcOperations().queryForObject(jumpToItemSql,
getParameterList(parameterValues, startAfterValue).toArray(), startMapper);
}
}