IN PROGRESS - issue BATCH-340: Refactor JobRepository for greater clarity and consistency.

http://jira.springframework.org/browse/BATCH-340

JobInstance now has not-null Job as required constructor argument - repository no longer requires a separate Job setter
This commit is contained in:
robokaso
2008-02-25 13:50:53 +00:00
parent 1244264e50
commit 4e05642f98
24 changed files with 109 additions and 99 deletions

View File

@@ -16,6 +16,8 @@
package org.springframework.batch.core.domain;
import org.springframework.util.Assert;
/**
@@ -36,14 +38,11 @@ public class JobInstance extends Entity {
private int jobExecutionCount;
private JobExecution lastExecution;
public JobInstance(Long id, JobParameters jobParameters) {
super(id);
this.jobParameters = jobParameters==null ? new JobParameters() : jobParameters;
}
public JobInstance(Long id, JobParameters jobParameters, Job job){
this(id, jobParameters);
super(id);
Assert.notNull(job);
this.jobParameters = jobParameters==null ? new JobParameters() : jobParameters;
this.job = job;
}
@@ -92,7 +91,4 @@ public class JobInstance extends Entity {
return job;
}
public void setJob(Job job) {
this.job = job;
}
}