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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user