org.springframework.batch.item.database.builder

## Class HibernateItemWriterBuilder<T>

- java.lang.Object
- - org.springframework.batch.item.database.builder.HibernateItemWriterBuilder<T>

-     public class HibernateItemWriterBuilder<T>
      extends java.lang.Object

  A builder for the `HibernateItemWriter`
  Since:
    4.0
  Author:
    Michael Minella
  See Also:
    `HibernateItemWriter`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HibernateItemWriterBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `HibernateItemWriter<T>` | `build()` Returns a fully built `HibernateItemWriter`
    `HibernateItemWriterBuilder<T>` | `clearSession(boolean clearSession)` If set to false, the `Session` will not be cleared at the end of the chunk.
    `HibernateItemWriterBuilder<T>` | `sessionFactory(org.hibernate.SessionFactory sessionFactory)` The Hibernate `SessionFactory` to obtain a session from.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HibernateItemWriterBuilder

          public HibernateItemWriterBuilder()

  - ### Method Detail

    - #### clearSession

          public HibernateItemWriterBuilder<T> clearSession(boolean clearSession)

      If set to false, the `Session` will not be cleared at the end of the chunk.
      Parameters:
        `clearSession` - defaults to true
      Returns:
        this instance for method chaining
      See Also:
        `HibernateItemWriter.setClearSession(boolean)`

    - #### sessionFactory

          public HibernateItemWriterBuilder<T> sessionFactory(org.hibernate.SessionFactory sessionFactory)

      The Hibernate `SessionFactory` to obtain a session from. Required.
      Parameters:
        `sessionFactory` - the `SessionFactory`
      Returns:
        this instance for method chaining
      See Also:
        `HibernateItemWriter.setSessionFactory(SessionFactory)`

    - #### build

          public HibernateItemWriter<T> build()

      Returns a fully built `HibernateItemWriter`
      Returns:
        the writer