Class StagingItemWriter<T>

    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      protected static java.lang.StringDONE 
      protected static java.lang.StringNEW 
      • Fields inherited from class org.springframework.dao.support.DaoSupport

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      ExitStatusafterStep​(StepExecution stepExecution)
      Give a listener a chance to modify the exit status from a step.
      voidbeforeStep​(StepExecution stepExecution)
      Initialize the state of the listener with the StepExecution from the current scope.
      protected voidinitDao()
      Check mandatory properties.
      voidsetIncrementer​(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer incrementer)
      Setter for the key generator for the staging table.
      voidwrite​(java.util.List<? extends T> items)
      Serialize the item to the staging table, and add a NEW processed flag.
      • Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport

        checkDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, initTemplateConfig, releaseConnection, setDataSource, setJdbcTemplate
      • Methods inherited from class org.springframework.dao.support.DaoSupport

        afterPropertiesSet
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StagingItemWriter

        public StagingItemWriter()
    • Method Detail

      • initDao

        protected void initDao()
                        throws java.lang.Exception
        Check mandatory properties.
        Overrides:
        initDao in class org.springframework.dao.support.DaoSupport
        Throws:
        java.lang.Exception
        See Also:
        DaoSupport.initDao()
      • setIncrementer

        public void setIncrementer​(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer incrementer)
        Setter for the key generator for the staging table.
        Parameters:
        incrementer - the DataFieldMaxValueIncrementer 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.
        Specified by:
        write in interface ItemWriter<T>
        Parameters:
        items - items to be written
        See Also:
        ItemWriter.write(java.util.List)
      • afterStep

        public ExitStatus afterStep​(StepExecution stepExecution)
        Description copied from interface: 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 using ExitStatus.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.
        Specified by:
        afterStep in interface StepExecutionListener
        Parameters:
        stepExecution - StepExecution instance.
        Returns:
        an ExitStatus to combine with the normal value. Return null to leave the old value unchanged.