类 StagingItemWriter<T>
- java.lang.Object
- org.springframework.dao.support.DaoSupport
- org.springframework.jdbc.core.support.JdbcDaoSupport
- org.springframework.batch.sample.common.StagingItemWriter<T>
- 所有已实现的接口:
StepExecutionListener
,StepListener
,ItemWriter<T>
,org.springframework.beans.factory.InitializingBean
public class StagingItemWriter<T> extends org.springframework.jdbc.core.support.JdbcDaoSupport implements StepExecutionListener, ItemWriter<T>
DatabaseItemWriter
implementing the process indicator pattern.
构造器概要
构造器 构造器 说明 StagingItemWriter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ExitStatus
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step.void
beforeStep(StepExecution stepExecution)
Initialize the state of the listener with theStepExecution
from the current scope.protected void
initDao()
Check mandatory properties.void
setIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer incrementer)
Setter for the key generator for the staging table.void
write(java.util.List<? extends T> items)
Serialize the item to the staging table, and add a NEW processed flag.
构造器详细资料
StagingItemWriter
public StagingItemWriter()
方法详细资料
initDao
protected void initDao() throws java.lang.Exception
Check mandatory properties.- 覆盖:
initDao
在类中org.springframework.dao.support.DaoSupport
- 抛出:
java.lang.Exception
- 另请参阅:
DaoSupport.initDao()
setIncrementer
public void setIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer incrementer)
Setter for the key generator for the staging table.- 参数:
incrementer
- theDataFieldMaxValueIncrementer
to set
write
public void write(java.util.List<? extends T> items)
Serialize the item to the staging table, and add a NEW processed flag.- 指定者:
write
在接口中ItemWriter<T>
- 参数:
items
- items to be written- 另请参阅:
ItemWriter.write(java.util.List)
afterStep
public ExitStatus afterStep(StepExecution stepExecution)
从接口复制的说明:StepExecutionListener
Give a listener a chance to modify the exit status from a step. The value returned will be combined with the normal exit status usingExitStatus.and(ExitStatus)
. Called after execution of step's processing logic (both successful or failed). Throwing exception in this method has no effect, it will only be logged.- 指定者:
afterStep
在接口中StepExecutionListener
- 参数:
stepExecution
-StepExecution
instance.- 返回:
- an
ExitStatus
to combine with the normal value. Returnnull
to leave the old value unchanged.
beforeStep
public void beforeStep(StepExecution stepExecution)
从接口复制的说明:StepExecutionListener
Initialize the state of the listener with theStepExecution
from the current scope.- 指定者:
beforeStep
在接口中StepExecutionListener
- 参数:
stepExecution
- instance ofStepExecution
.