类 JdbcJobExecutionDao
- java.lang.Object
- org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
- org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
- 所有已实现的接口:
JobExecutionDao
,org.springframework.beans.factory.InitializingBean
public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements JobExecutionDao, org.springframework.beans.factory.InitializingBean
JDBC implementation ofJobExecutionDao
. Uses sequences (via Spring'sDataFieldMaxValueIncrementer
abstraction) to create all primary keys before inserting a new row. Objects are checked to ensure all mandatory fields to be stored are not null. If any are found to be null, an IllegalArgumentException will be thrown. This could be left to JdbcTemplate, however, the exception will be fairly vague, and fails to highlight which field caused the exception.- 作者:
- Lucas Ward, Dave Syer, Robert Kasanicky, Michael Minella, Mahmoud Ben Hassine, Dimitrios Liapis
字段概要
从类继承的字段 org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
DEFAULT_EXIT_MESSAGE_LENGTH, DEFAULT_TABLE_PREFIX
构造器概要
构造器 构造器 说明 JdbcJobExecutionDao()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
java.util.List<JobExecution>
findJobExecutions(JobInstance job)
Return allJobExecution
s for givenJobInstance
, sorted backwards by creation order (so the first element is the most recent).java.util.Set<JobExecution>
findRunningJobExecutions(java.lang.String jobName)
JobExecution
getJobExecution(java.lang.Long executionId)
protected JobParameters
getJobParameters(java.lang.Long executionId)
JobExecution
getLastJobExecution(JobInstance jobInstance)
Find the lastJobExecution
to have been created for a givenJobInstance
.void
saveJobExecution(JobExecution jobExecution)
SQL implementation using Sequences via the Spring incrementer abstraction.void
setExitMessageLength(int exitMessageLength)
Public setter for the exit message length in database.void
setJobExecutionIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer jobExecutionIncrementer)
Setter forDataFieldMaxValueIncrementer
to be used when generating primary keys forJobExecution
instances.void
synchronizeStatus(JobExecution jobExecution)
Because it may be possible that the status of a JobExecution is updated while running, the following method will synchronize only the status and version fields.void
updateJobExecution(JobExecution jobExecution)
Update given JobExecution using a SQL UPDATE statement.从类继承的方法 org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
getClobTypeToUse, getJdbcTemplate, getQuery, getTablePrefix, setClobTypeToUse, setJdbcTemplate, setTablePrefix
构造器详细资料
JdbcJobExecutionDao
public JdbcJobExecutionDao()
方法详细资料
setExitMessageLength
public void setExitMessageLength(int exitMessageLength)
Public setter for the exit message length in database. Do not set this if you haven't modified the schema.- 参数:
exitMessageLength
- the exitMessageLength to set
setJobExecutionIncrementer
public void setJobExecutionIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer jobExecutionIncrementer)
Setter forDataFieldMaxValueIncrementer
to be used when generating primary keys forJobExecution
instances.- 参数:
jobExecutionIncrementer
- theDataFieldMaxValueIncrementer
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 覆盖:
afterPropertiesSet
在类中AbstractJdbcBatchMetadataDao
- 抛出:
java.lang.Exception
findJobExecutions
public java.util.List<JobExecution> findJobExecutions(JobInstance job)
从接口复制的说明:JobExecutionDao
Return allJobExecution
s for givenJobInstance
, sorted backwards by creation order (so the first element is the most recent).- 指定者:
findJobExecutions
在接口中JobExecutionDao
- 参数:
job
- parentJobInstance
of theJobExecution
s to find.- 返回:
List
containing JobExecutions for the jobInstance.
saveJobExecution
public void saveJobExecution(JobExecution jobExecution)
SQL implementation using Sequences via the Spring incrementer abstraction. Once a new id has been obtained, the JobExecution is saved via a SQL INSERT statement.- 指定者:
saveJobExecution
在接口中JobExecutionDao
- 参数:
jobExecution
-JobExecution
instance to be saved.- 抛出:
java.lang.IllegalArgumentException
- if jobExecution is null, as well as any of it's fields to be persisted.- 另请参阅:
JobExecutionDao.saveJobExecution(JobExecution)
updateJobExecution
public void updateJobExecution(JobExecution jobExecution)
Update given JobExecution using a SQL UPDATE statement. The JobExecution is first checked to ensure all fields are not null, and that it has an ID. The database is then queried to ensure that the ID exists, which ensures that it is valid.- 指定者:
updateJobExecution
在接口中JobExecutionDao
- 参数:
jobExecution
-JobExecution
instance to be updated.- 另请参阅:
JobExecutionDao.updateJobExecution(JobExecution)
getLastJobExecution
public JobExecution getLastJobExecution(JobInstance jobInstance)
从接口复制的说明:JobExecutionDao
Find the lastJobExecution
to have been created for a givenJobInstance
.- 指定者:
getLastJobExecution
在接口中JobExecutionDao
- 参数:
jobInstance
- theJobInstance
- 返回:
- the last
JobExecution
to execute for this instance ornull
if no job execution is found for the given job instance.
getJobExecution
@Nullable public JobExecution getJobExecution(java.lang.Long executionId)
- 指定者:
getJobExecution
在接口中JobExecutionDao
- 参数:
executionId
-Long
containing the id of the execution.- 返回:
- the
JobExecution
for given identifier.
findRunningJobExecutions
public java.util.Set<JobExecution> findRunningJobExecutions(java.lang.String jobName)
- 指定者:
findRunningJobExecutions
在接口中JobExecutionDao
- 参数:
jobName
-String
containing the name of the job.- 返回:
- all
JobExecution
that are still running (or indeterminate state), i.e. having null end date, for the specified job name.
synchronizeStatus
public void synchronizeStatus(JobExecution jobExecution)
从接口复制的说明:JobExecutionDao
Because it may be possible that the status of a JobExecution is updated while running, the following method will synchronize only the status and version fields.- 指定者:
synchronizeStatus
在接口中JobExecutionDao
- 参数:
jobExecution
- to be updated.
getJobParameters
protected JobParameters getJobParameters(java.lang.Long executionId)
- 参数:
executionId
-Long
containing the id for the execution.- 返回:
- job parameters for the requested execution id