Added subclass mapping to JobInstance to support existing JobIdentifier strategies.
OPEN - issue BATCH-84: Simplify JobLauncher so it can be used to start a job with a String/Properties http://opensource.atlassian.com/projects/spring/browse/BATCH-84
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE hibernate-mapping PUBLIC
|
||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" [
|
||||
@@ -8,18 +8,42 @@
|
||||
<hibernate-mapping package="org.springframework.batch.core.domain">
|
||||
|
||||
<class name="JobInstance" table="BATCH_JOB">
|
||||
|
||||
<id name="id" type="long" column="ID">
|
||||
&job-generator;
|
||||
</id>
|
||||
<version name="version" access="field" />
|
||||
<component name="identifier" class="org.springframework.batch.execution.runtime.ScheduledJobIdentifier">
|
||||
<property name="name" update="false" column="JOB_NAME" />
|
||||
<property name="jobStream" update="false" column="JOB_STREAM" />
|
||||
<property name="scheduleDate" update="false" column="SCHEDULE_DATE" />
|
||||
<property name="jobRun" update="false" column="JOB_RUN" />
|
||||
</component>
|
||||
<property name="status" type="org.springframework.batch.execution.repository.dao.BatchStatusUserType"
|
||||
insert="false" column="STATUS" />
|
||||
</class>
|
||||
|
||||
<discriminator
|
||||
formula="case when SCHEDULE_DATE is NULL then 'Scheduled' else 'Simple' end"
|
||||
type="string" />
|
||||
|
||||
<version name="version" access="field" />
|
||||
|
||||
<property name="status"
|
||||
type="org.springframework.batch.execution.repository.dao.BatchStatusUserType"
|
||||
insert="false" column="STATUS" />
|
||||
|
||||
<subclass entity-name="ScheduledJobInstance" name="JobInstance"
|
||||
discriminator-value="Scheduled">
|
||||
<component name="identifier"
|
||||
class="org.springframework.batch.execution.runtime.ScheduledJobIdentifier">
|
||||
<property name="name" update="false" column="JOB_NAME" />
|
||||
<property name="jobStream" update="false"
|
||||
column="JOB_STREAM" />
|
||||
<property name="scheduleDate" update="false"
|
||||
column="SCHEDULE_DATE" />
|
||||
<property name="jobRun" update="false" column="JOB_RUN" />
|
||||
</component>
|
||||
</subclass>
|
||||
|
||||
<subclass entity-name="SimpleJobInstance" name="JobInstance"
|
||||
discriminator-value="Simple">
|
||||
<component name="identifier"
|
||||
class="org.springframework.batch.core.runtime.SimpleJobIdentifier">
|
||||
<property name="name" update="false" column="JOB_NAME" />
|
||||
</component>
|
||||
</subclass>
|
||||
|
||||
</class>
|
||||
|
||||
</hibernate-mapping>
|
||||
Reference in New Issue
Block a user