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 theHibernateItemWriter
- Since:
- 4.0
- Author:
- Michael Minella
- See Also:
HibernateItemWriter
Constructor Summary
Constructors Constructor Description HibernateItemWriterBuilder()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HibernateItemWriter<T>
build()
Returns a fully builtHibernateItemWriter
HibernateItemWriterBuilder<T>
clearSession(boolean clearSession)
If set to false, theSession
will not be cleared at the end of the chunk.HibernateItemWriterBuilder<T>
sessionFactory(org.hibernate.SessionFactory sessionFactory)
The HibernateSessionFactory
to obtain a session from.
Method Detail
clearSession
public HibernateItemWriterBuilder<T> clearSession(boolean clearSession)
If set to false, theSession
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 HibernateSessionFactory
to obtain a session from. Required.- Parameters:
sessionFactory
- theSessionFactory
- Returns:
- this instance for method chaining
- See Also:
HibernateItemWriter.setSessionFactory(SessionFactory)
build
public HibernateItemWriter<T> build()
Returns a fully builtHibernateItemWriter
- Returns:
- the writer