diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepInstanceDao.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepInstanceDao.java index c46a5a743..48be14898 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepInstanceDao.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepInstanceDao.java @@ -38,8 +38,6 @@ public class JdbcStepInstanceDao extends AbstractJdbcBatchMetadataDao implements private static final String FIND_STEP = "SELECT STEP_INSTANCE_ID from %PREFIX%STEP_INSTANCE where JOB_INSTANCE_ID = ? " + "and STEP_NAME = ?"; - private static final String FIND_STEPS = "SELECT STEP_INSTANCE_ID, STEP_NAME from %PREFIX%STEP_INSTANCE where JOB_INSTANCE_ID = ?"; - private DataFieldMaxValueIncrementer stepIncrementer; /** @@ -105,25 +103,6 @@ public class JdbcStepInstanceDao extends AbstractJdbcBatchMetadataDao implements } - /** - * @see StepDao#findStepInstances(JobInstance) - * - * Sql implementation which uses a RowMapper to populate a list of all rows - * in the step table with the same JOB_INSTANCE_ID. - * - * @throws IllegalArgumentException if jobId is null. - */ - public List findStepInstances(final JobInstance jobInstance) { - - Assert.notNull(jobInstance, "Job cannot be null."); - - Object[] parameters = new Object[] { jobInstance.getId() }; - - RowMapper rowMapper = new StepInstanceRowMapper(jobInstance, null); - - return getJdbcTemplate().query(getQuery(FIND_STEPS), parameters, rowMapper); - } - public void setStepIncrementer(DataFieldMaxValueIncrementer stepIncrementer) { this.stepIncrementer = stepIncrementer; } diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/StepInstanceDao.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/StepInstanceDao.java index a26544b45..b599d29f0 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/StepInstanceDao.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/StepInstanceDao.java @@ -1,7 +1,5 @@ package org.springframework.batch.execution.repository.dao; -import java.util.List; - import org.springframework.batch.core.domain.JobInstance; import org.springframework.batch.core.domain.StepInstance; @@ -17,14 +15,6 @@ public interface StepInstanceDao { */ StepInstance findStepInstance(JobInstance jobInstance, String stepName); - /** - * Find all StepInstances of the given JobInstance. - * - * @param jobInstance the job to use as a search key - * @return list of {@link StepInstance} - */ - List findStepInstances(JobInstance jobInstance); - /** * Create a StepInstance for the given name and JobInstance. * diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/AbstractStepDaoTests.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/AbstractStepDaoTests.java index eb11eaac9..25cf9f47f 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/AbstractStepDaoTests.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/AbstractStepDaoTests.java @@ -17,7 +17,6 @@ package org.springframework.batch.execution.repository.dao; import java.util.Date; -import java.util.List; import org.springframework.batch.core.domain.BatchStatus; import org.springframework.batch.core.domain.Job; @@ -139,21 +138,6 @@ public abstract class AbstractStepDaoTests extends AbstractTransactionalDataSour assertEquals(tempStep, step1); } - public void testFindSteps() { - - List steps = stepInstanceDao.findStepInstances(jobInstance); - assertEquals(steps.size(), 2); - assertTrue(steps.contains(step1)); - assertTrue(steps.contains(step2)); - } - - public void testFindStepsNotSaved() { - - // no steps are saved for given id, empty list should be returned - List steps = stepInstanceDao.findStepInstances(new JobInstance(new Long(38922), jobParameters)); - assertEquals(steps.size(), 0); - } - public void testCreateStep() { StepInstance step3 = stepInstanceDao.createStepInstance(jobInstance, "TestStep3"); diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/JdbcStepDaoPrefixTests.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/JdbcStepDaoPrefixTests.java index 5e7d77a3b..60bb7f9a7 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/JdbcStepDaoPrefixTests.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/repository/dao/JdbcStepDaoPrefixTests.java @@ -85,12 +85,6 @@ public class JdbcStepDaoPrefixTests extends TestCase { assertTrue(jdbcTemplate.getSqlStatement().indexOf("FOO_STEP") != -1); } - public void testModifiedFindSteps(){ - stepInstanceDao.setTablePrefix("FOO_"); - stepInstanceDao.findStepInstances(new JobInstance(new Long(1), new JobParameters())); - assertTrue(jdbcTemplate.getSqlStatement().indexOf("FOO_STEP") != -1); - } - public void testModifiedFindStep(){ stepInstanceDao.setTablePrefix("FOO_"); try{ @@ -117,11 +111,6 @@ public class JdbcStepDaoPrefixTests extends TestCase { } - public void testDefaultFindSteps(){ - stepInstanceDao.findStepInstances(new JobInstance(new Long(1), new JobParameters())); - assertTrue(jdbcTemplate.getSqlStatement().indexOf("BATCH_STEP") != -1); - } - public void testDefaultCreateStep(){ stepIncrementer.nextLongValue(); stepIncrementerControl.setReturnValue(1);