OPEN - issue BATCH-90: StepExecution and StepExecutionContext are parallel domains, and StepExecution is by comparison anaemic

http://opensource.atlassian.com/projects/spring/browse/BATCH-90

Remove jobId field from JobExecution
This commit is contained in:
dsyer
2007-09-30 16:41:24 +00:00
parent 7f7959f1fa
commit f18ab81ab3
4 changed files with 4 additions and 4 deletions

View File

@@ -98,7 +98,7 @@ public class HibernateJobDao extends HibernateDaoSupport implements JobDao {
public Object doInHibernate(Session session) {
return session
.createQuery(
"select count(id) from JobExecution where jobId = :jobId")
"select count(id) from JobExecution where job.id = :jobId")
.setLong("jobId", jobId.longValue())
.uniqueResult();
}

View File

@@ -12,7 +12,7 @@
&job-execution-generator;
</id>
<version name="version" access="field"/>
<property name="jobId" type="long" update="false" column="JOB_ID" access="field"/>
<many-to-one name="job" cascade="all" update="false" column="JOB_ID" access="field"/>
<property name="startTime" column="START_TIME" />
<property name="endTime" column="END_TIME" />
<property name="status" type="org.springframework.batch.execution.repository.dao.BatchStatusUserType" column="STATUS" />

View File

@@ -13,7 +13,7 @@
</id>
<version name="version" access="field"/>
<many-to-one name="step" update="false" column="STEP_ID" access="field"/>
<many-to-one name="jobExecution" cascade="save-update" update="false" column="JOB_EXECUTION_ID" access="field"/>
<many-to-one name="jobExecution" cascade="all" update="false" column="JOB_EXECUTION_ID" access="field"/>
<property name="startTime" column="START_TIME" />
<property name="endTime" column="END_TIME" />
<property name="status" type="org.springframework.batch.execution.repository.dao.BatchStatusUserType" column="STATUS" />

View File

@@ -80,7 +80,7 @@ public abstract class AbstractJobDaoTests extends
// Create an execution
jobExecutionStartTime = new Timestamp(System.currentTimeMillis());
jobExecution = new JobExecution(new JobInstance(jobRuntimeInformation, job.getId()));
jobExecution = new JobExecution(job);
jobExecution.setStartTime(jobExecutionStartTime);
jobExecution.setStatus(BatchStatus.STARTED);
jobDao.save(jobExecution);