From 1128bbe187e0a5b401a741a0d4d5eca85a2e39c3 Mon Sep 17 00:00:00 2001 From: robokaso Date: Thu, 7 Feb 2008 11:47:43 +0000 Subject: [PATCH] IN PROGRESS - issue BATCH-340: Refactor JobRepository for greater clarity and consistency. http://jira.springframework.org/browse/BATCH-340 renaming and javadoc updates --- .../repository/SimpleJobRepository.java | 56 ++++++------- .../execution/repository/dao/JdbcJobDao.java | 12 +-- .../execution/repository/dao/JdbcStepDao.java | 30 +++---- .../execution/repository/dao/JobDao.java | 61 ++++++++------- .../execution/repository/dao/MapJobDao.java | 6 +- .../execution/repository/dao/MapStepDao.java | 16 ++-- .../execution/repository/dao/StepDao.java | 78 +++++++++---------- .../execution/repository/MockStepDao.java | 16 ++-- .../repository/SimpleJobRepositoryTests.java | 56 ++++++------- .../repository/dao/AbstractJobDaoTests.java | 20 ++--- .../repository/dao/AbstractStepDaoTests.java | 44 +++++------ .../repository/dao/JdbcJobDaoQueryTests.java | 2 +- .../repository/dao/JdbcJobDaoTests.java | 2 +- .../dao/JdbcStepDaoPrefixTests.java | 24 +++--- .../repository/dao/JdbcStepDaoTests.java | 2 +- .../repository/dao/MapJobDaoTests.java | 12 +-- .../repository/dao/MapStepDaoTests.java | 30 +++---- 17 files changed, 236 insertions(+), 231 deletions(-) diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/SimpleJobRepository.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/SimpleJobRepository.java index 966918283..dd628c7f3 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/SimpleJobRepository.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/SimpleJobRepository.java @@ -46,6 +46,7 @@ import org.springframework.util.Assert; * * @author Lucas Ward * @author Dave Syer + * * @see JobRepository * @see StepDao * @see JobDao @@ -72,23 +73,24 @@ public class SimpleJobRepository implements JobRepository { /** *

- * Create a (@link {@link JobExecution}) based on the passed in - * {@link JobIdentifier} and {@link JobSupport}. However, unique identification of - * a job can only come from the database, and therefore must come from - * JobDao by either creating a new job or finding an existing one, which - * will ensure that the id of the job is populated with the correct value. + * Create a {@link JobExecution} based on the passed in + * {@link JobIdentifier} and {@link JobSupport}. However, unique + * identification of a job can only come from the database, and therefore + * must come from JobDao by either creating a new job or finding an existing + * one, which will ensure that the id of the job is populated with the + * correct value. *

* *

* There are two ways in which the method determines if a job should be * created or an existing one should be returned. The first is - * restartability. The {@link JobSupport} restartable property will be checked - * first. If it is not false, a new job will be created, regardless of - * whether or not one exists. If it is true, the {@link JobDao} will be + * restartability. The {@link JobSupport} restartable property will be + * checked first. If it is false, a new job will be created, regardless + * of whether or not one exists. If it is true, the {@link JobDao} will be * checked to determine if the job already exists, if it does, it's steps * will be populated (there must be at least 1) and a new * {@link JobExecution} will be returned. If no job is found, a new one will - * be created based on the job. + * be created. *

* *

@@ -100,10 +102,10 @@ public class SimpleJobRepository implements JobRepository { *

  • What happens then depends on how many existing job instances we * find: *