}
else {
whereClause = whereClause + " AND STEP_NAME = ?";
}
PagingQueryProvider queryProvider = getPagingQueryProvider(whereClause);
List<StepExecution> stepExecutions;
if (start <= 0) {
stepExecutions = getJdbcTemplate().query(queryProvider.generateFirstPageQuery(count),
new StepExecutionRowMapper(), jobName, stepName);
}
else {
try {
Long startAfterValue = getJdbcTemplate().queryForObject(
queryProvider.generateJumpToItemQuery(start, count), Long.class, jobName, stepName);
stepExecutions = getJdbcTemplate().query(queryProvider.generateRemainingPagesQuery(count),
new StepExecutionRowMapper(), jobName, stepName, startAfterValue);
}
catch (IncorrectResultSizeDataAccessException e) {
return Collections.emptyList();
}