Removed dependency on ParameterizedRowMapper

To support Spring Framework 4.2 which removes ParameterizedRowMapper,
all references to that were switched to RowMapper.  As of Spring 3, the
interfaces are identicle so this should cause no backward compatability
issues.

BATCH-2369
This commit is contained in:
Michael Minella
2015-03-31 14:06:10 -05:00
parent 63c0777462
commit adc2f79242
21 changed files with 85 additions and 69 deletions

View File

@@ -19,7 +19,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.core.test.football.PlayerSummary;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
/**
* RowMapper used to map a ResultSet to a {@link PlayerSummary}
@@ -27,7 +27,7 @@ import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
* @author Lucas Ward
*
*/
public class PlayerSummaryMapper implements ParameterizedRowMapper<PlayerSummary> {
public class PlayerSummaryMapper implements RowMapper<PlayerSummary> {
/* (non-Javadoc)
* @see org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet, int)

View File

@@ -32,6 +32,7 @@ import org.apache.commons.logging.LogFactory;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
@@ -45,8 +46,9 @@ import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.ParseException;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -213,7 +215,7 @@ public class FaultTolerantStepFactoryBeanIntegrationTests {
public List<String> getCommitted() {
return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='written'",
new ParameterizedRowMapper<String>() {
new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getString(1);
@@ -259,7 +261,7 @@ public class FaultTolerantStepFactoryBeanIntegrationTests {
public List<String> getCommitted() {
return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='processed'",
new ParameterizedRowMapper<String>() {
new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getString(1);

View File

@@ -35,6 +35,7 @@ import org.apache.commons.logging.LogFactory;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
@@ -48,8 +49,9 @@ import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.ParseException;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -238,7 +240,7 @@ public class FaultTolerantStepFactoryBeanRollbackIntegrationTests {
public List<String> getCommitted() {
return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='written'",
new ParameterizedRowMapper<String>() {
new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getString(1);
@@ -291,7 +293,7 @@ public class FaultTolerantStepFactoryBeanRollbackIntegrationTests {
public List<String> getCommitted() {
return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='processed'",
new ParameterizedRowMapper<String>() {
new RowMapper<String>() {
@Override
public String mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getString(1);

View File

@@ -36,7 +36,7 @@ import org.springframework.batch.item.ExecutionContext;
import org.springframework.core.serializer.Serializer;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.lob.DefaultLobHandler;
import org.springframework.jdbc.support.lob.LobHandler;
import org.springframework.util.Assert;
@@ -306,7 +306,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
return results;
}
private class ExecutionContextRowMapper implements ParameterizedRowMapper<ExecutionContext> {
private class ExecutionContextRowMapper implements RowMapper<ExecutionContext> {
@Override
public ExecutionContext mapRow(ResultSet rs, int i) throws SQLException {

View File

@@ -29,6 +29,7 @@ import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.JobExecution;
@@ -40,7 +41,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import org.springframework.util.Assert;
@@ -390,7 +391,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
* @author Dave Syer
*
*/
private final class JobExecutionRowMapper implements ParameterizedRowMapper<JobExecution> {
private final class JobExecutionRowMapper implements RowMapper<JobExecution> {
private JobInstance jobInstance;

View File

@@ -32,6 +32,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import org.springframework.util.Assert;
@@ -138,7 +139,7 @@ JobInstanceDao, InitializingBean {
String jobKey = jobKeyGenerator.generateKey(jobParameters);
ParameterizedRowMapper<JobInstance> rowMapper = new JobInstanceRowMapper();
RowMapper<JobInstance> rowMapper = new JobInstanceRowMapper();
List<JobInstance> instances;
if (StringUtils.hasLength(jobKey)) {
@@ -218,7 +219,7 @@ JobInstanceDao, InitializingBean {
rowNum++;
}
while (rowNum < start + count && rs.next()) {
ParameterizedRowMapper<JobInstance> rowMapper = new JobInstanceRowMapper();
RowMapper<JobInstance> rowMapper = new JobInstanceRowMapper();
list.add(rowMapper.mapRow(rs, rowNum));
rowNum++;
}
@@ -289,8 +290,7 @@ JobInstanceDao, InitializingBean {
* @author Dave Syer
*
*/
private final class JobInstanceRowMapper implements
ParameterizedRowMapper<JobInstance> {
private final class JobInstanceRowMapper implements RowMapper<JobInstance> {
public JobInstanceRowMapper() {
}
@@ -318,7 +318,7 @@ JobInstanceDao, InitializingBean {
rowNum++;
}
while (rowNum < start + count && rs.next()) {
ParameterizedRowMapper<JobInstance> rowMapper = new JobInstanceRowMapper();
RowMapper<JobInstance> rowMapper = new JobInstanceRowMapper();
list.add(rowMapper.mapRow(rs, rowNum));
rowNum++;
}

View File

@@ -16,19 +16,6 @@
package org.springframework.batch.core.repository.dao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import org.springframework.util.Assert;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -40,6 +27,20 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import org.springframework.util.Assert;
/**
* JDBC implementation of {@link StepExecutionDao}.<br>
*
@@ -297,7 +298,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
jobExecution.getId());
}
private static class StepExecutionRowMapper implements ParameterizedRowMapper<StepExecution> {
private static class StepExecutionRowMapper implements RowMapper<StepExecution> {
private final JobExecution jobExecution;

View File

@@ -40,15 +40,16 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.database.support.SqlPagingQueryProviderFactoryBean;
import org.springframework.batch.item.sample.Foo;
import org.springframework.test.jdbc.JdbcTestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.jdbc.JdbcTestUtils;
/**
* @author Dave Syer
@@ -168,7 +169,7 @@ public class JdbcPagingItemReaderAsyncTests {
sortKeys.put("VALUE", Order.ASCENDING);
factory.setSortKeys(sortKeys);
reader.setQueryProvider(factory.getObject());
reader.setRowMapper(new ParameterizedRowMapper<Foo>() {
reader.setRowMapper(new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -35,6 +35,7 @@ import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
@@ -42,7 +43,7 @@ import org.springframework.batch.item.database.support.SqlPagingQueryProviderFac
import org.springframework.batch.item.sample.Foo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.jdbc.JdbcTestUtils;
@@ -159,7 +160,7 @@ public class JdbcPagingRestartIntegrationTests {
sortKeys.put("VALUE", Order.ASCENDING);
factory.setSortKeys(sortKeys);
reader.setQueryProvider(factory.getObject());
reader.setRowMapper(new ParameterizedRowMapper<Foo>() {
reader.setRowMapper(new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -135,7 +135,7 @@ public class JdbcPagingItemReader<T> extends AbstractPagingItemReader<T> impleme
* by the reader.
*
* @param rowMapper a
* {@link org.springframework.jdbc.core.simple.ParameterizedRowMapper}
* {@link RowMapper}
* implementation
*/
public void setRowMapper(RowMapper<T> rowMapper) {

View File

@@ -40,15 +40,16 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.database.support.HsqlPagingQueryProvider;
import org.springframework.batch.item.sample.Foo;
import org.springframework.test.jdbc.JdbcTestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.jdbc.JdbcTestUtils;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "JdbcPagingItemReaderCommonTests-context.xml")
@@ -162,7 +163,7 @@ public class JdbcPagingItemReaderAsyncTests {
sortKeys.put("ID", Order.ASCENDING);
queryProvider.setSortKeys(sortKeys);
reader.setQueryProvider(queryProvider);
reader.setRowMapper(new ParameterizedRowMapper<Foo>() {
reader.setRowMapper(new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -23,9 +23,10 @@ import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.database.support.HsqlPagingQueryProvider;
import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.util.ReflectionTestUtils;
@@ -65,7 +66,7 @@ public class JdbcPagingItemReaderClassicParameterTests extends AbstractJdbcPagin
reader.setParameterValues(Collections.<String, Object>singletonMap("limit", 2));
reader.setQueryProvider(queryProvider);
reader.setRowMapper(
new ParameterizedRowMapper<Foo>() {
new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -23,13 +23,14 @@ import java.util.Map;
import javax.sql.DataSource;
import org.junit.runner.RunWith;
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.database.support.HsqlPagingQueryProvider;
import org.springframework.batch.item.sample.Foo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -58,7 +59,7 @@ public class JdbcPagingItemReaderCommonTests extends AbstractItemStreamItemReade
queryProvider.setSortKeys(sortKeys);
reader.setQueryProvider(queryProvider);
reader.setRowMapper(
new ParameterizedRowMapper<Foo>() {
new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -23,7 +23,7 @@ import java.util.Map;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.database.support.HsqlPagingQueryProvider;
import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
/**
* Tests for {@link JpaPagingItemReader}.
@@ -46,7 +46,7 @@ public class JdbcPagingItemReaderIntegrationTests extends AbstractGenericDataSou
queryProvider.setSortKeys(sortKeys);
inputSource.setQueryProvider(queryProvider);
inputSource.setRowMapper(
new ParameterizedRowMapper<Foo>() {
new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -23,9 +23,10 @@ import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.database.support.HsqlPagingQueryProvider;
import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.util.ReflectionTestUtils;
@@ -64,7 +65,7 @@ public class JdbcPagingItemReaderNamedParameterTests extends AbstractJdbcPagingI
reader.setParameterValues(Collections.<String, Object>singletonMap("limit", 2));
reader.setQueryProvider(queryProvider);
reader.setRowMapper(
new ParameterizedRowMapper<Foo>() {
new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -23,7 +23,7 @@ import java.util.Map;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.database.support.HsqlPagingQueryProvider;
import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
/**
* Tests for {@link JpaPagingItemReader} with sort key not equal to ID.
@@ -47,7 +47,7 @@ public class JdbcPagingItemReaderOrderIntegrationTests extends AbstractGenericDa
queryProvider.setSortKeys(sortKeys);
inputSource.setQueryProvider(queryProvider);
inputSource.setRowMapper(
new ParameterizedRowMapper<Foo>() {
new RowMapper<Foo>() {
@Override
public Foo mapRow(ResultSet rs, int i) throws SQLException {
Foo foo = new Foo();

View File

@@ -25,6 +25,7 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;
@@ -34,7 +35,7 @@ import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.util.Assert;
import org.springframework.util.SerializationUtils;
@@ -82,7 +83,7 @@ InitializingBean, DisposableBean {
"SELECT ID FROM BATCH_STAGING WHERE JOB_ID=? AND PROCESSED=? ORDER BY ID",
new ParameterizedRowMapper<Long>() {
new RowMapper<Long>() {
@Override
public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getLong(1);
@@ -114,7 +115,7 @@ InitializingBean, DisposableBean {
}
@SuppressWarnings("unchecked")
T result = (T) jdbcTemplate.queryForObject("SELECT VALUE FROM BATCH_STAGING WHERE ID=?",
new ParameterizedRowMapper<Object>() {
new RowMapper<Object>() {
@Override
public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
byte[] blob = rs.getBytes(1);

View File

@@ -19,7 +19,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.football.PlayerSummary;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
/**
* RowMapper used to map a ResultSet to a {@link PlayerSummary}
@@ -27,7 +27,7 @@ import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
* @author Lucas Ward
*
*/
public class PlayerSummaryMapper implements ParameterizedRowMapper<PlayerSummary> {
public class PlayerSummaryMapper implements RowMapper<PlayerSummary> {
/* (non-Javadoc)
* @see org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet, int)

View File

@@ -28,6 +28,7 @@ import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.sample.domain.trade.internal.CustomerCreditIncreaseProcessor;
@@ -38,7 +39,7 @@ import org.springframework.jdbc.UncategorizedSQLException;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.orm.hibernate3.HibernateJdbcException;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -121,7 +122,7 @@ public class HibernateFailureJobFunctionalTests {
creditsBeforeUpdate = new TransactionTemplate(transactionManager).execute(new TransactionCallback<List<BigDecimal>>() {
@Override
public List<BigDecimal> doInTransaction(TransactionStatus status) {
return jdbcTemplate.query(ALL_CUSTOMERS, new ParameterizedRowMapper<BigDecimal>() {
return jdbcTemplate.query(ALL_CUSTOMERS, new RowMapper<BigDecimal>() {
@Override
public BigDecimal mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getBigDecimal(CREDIT_COLUMN);

View File

@@ -26,11 +26,12 @@ import javax.sql.DataSource;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.sample.domain.football.Game;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
@@ -82,7 +83,7 @@ public class JdbcGameDaoIntegrationTests {
assertEquals(tempGame, game);
}
private static class GameRowMapper implements ParameterizedRowMapper<Game> {
private static class GameRowMapper implements RowMapper<Game> {
@Override
public Game mapRow(ResultSet rs, int arg1) throws SQLException {
if (rs == null) {

View File

@@ -15,6 +15,15 @@
*/
package org.springframework.batch.test;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobParameter;
@@ -30,17 +39,9 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.util.Assert;
import javax.sql.DataSource;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Convenience class for creating and removing {@link JobExecution} instances
* from a database. Typical usage in test case would be to create instances
@@ -163,7 +164,7 @@ public class JobRepositoryTestUtils extends AbstractJdbcBatchMetadataDao impleme
for (JobExecution jobExecution : list) {
List<Long> stepExecutionIds = jdbcTemplate.query(
getQuery("select STEP_EXECUTION_ID from %PREFIX%STEP_EXECUTION where JOB_EXECUTION_ID=?"),
new ParameterizedRowMapper<Long>() {
new RowMapper<Long>() {
@Override
public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
return rs.getLong(1);