IN PROGRESS - BATCH-518: clean up the *Or* repository methods

created standalone ExecutionContextDao interface
This commit is contained in:
robokaso
2008-07-28 12:14:56 +00:00
parent 43354849a5
commit 97835a76d8
4 changed files with 42 additions and 5 deletions

View File

@@ -0,0 +1,37 @@
package org.springframework.batch.core.repository.dao;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.item.ExecutionContext;
/**
* DAO interface for persisting and retrieving {@link ExecutionContext}s.
*
* @author Robert Kasanicky
*/
public interface ExecutionContextDao {
/**
* @param jobExecution
* @return execution context associated with the given jobExecution
*/
ExecutionContext getExecutionContext(JobExecution jobExecution);
/**
* @param stepExecution
* @return execution context associated with the given stepExecution
*/
ExecutionContext getExecutionContext(StepExecution stepExecution);
/**
* Persist the execution context associated with the given jobExecution
* @param jobExecution
*/
void persistExecutionContext(final JobExecution jobExecution);
/**
* Persist the execution context associated with the given stepExecution
* @param stepExecution
*/
void persistExecutionContext(final StepExecution stepExecution);
}

View File

@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
* @author Lucas Ward
* @author Robert Kasanicky
*/
class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao {
public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implements ExecutionContextDao {
private static final String STEP_DISCRIMINATOR = "S";
@@ -83,7 +83,7 @@ class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao {
* jobExecution
* @param jobExecution
*/
public void saveOrUpdateExecutionContext(final JobExecution jobExecution) {
public void persistExecutionContext(final JobExecution jobExecution) {
Long executionId = jobExecution.getId();
ExecutionContext executionContext = jobExecution.getExecutionContext();
Assert.notNull(executionId, "ExecutionId must not be null.");
@@ -97,7 +97,7 @@ class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao {
* stepExecution
* @param stepExecution
*/
public void saveOrUpdateExecutionContext(final StepExecution stepExecution) {
public void persistExecutionContext(final StepExecution stepExecution) {
Long executionId = stepExecution.getId();
ExecutionContext executionContext = stepExecution.getExecutionContext();

View File

@@ -237,7 +237,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
}
public void persistExecutionContext(JobExecution jobExecution) {
ecDao.saveOrUpdateExecutionContext(jobExecution);
ecDao.persistExecutionContext(jobExecution);
}
public void setLobHandler(LobHandler lobHandler) {

View File

@@ -139,7 +139,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
*/
public void persistExecutionContext(final StepExecution stepExecution) {
ecDao.saveOrUpdateExecutionContext(stepExecution);
ecDao.persistExecutionContext(stepExecution);
}
/*