Package org.mybatis.spring.batch.builder
Class MyBatisBatchItemWriterBuilder<T>
java.lang.Object
org.mybatis.spring.batch.builder.MyBatisBatchItemWriterBuilder<T>
public class MyBatisBatchItemWriterBuilder<T> extends Object
A builder for the
MyBatisBatchItemWriter
.- Since:
- 2.0.0
- Author:
- Kazuki Shimizu
- See Also:
MyBatisBatchItemWriter
-
Constructor Summary
Constructors Constructor Description MyBatisBatchItemWriterBuilder()
-
Method Summary
Modifier and Type Method Description MyBatisBatchItemWriterBuilder<T>
assertUpdates(boolean assertUpdates)
The flag that determines whether an assertion is made that all items cause at least one row to be updated.MyBatisBatchItemWriter<T>
build()
Returns a fully builtMyBatisBatchItemWriter
.MyBatisBatchItemWriterBuilder<T>
itemToParameterConverter(org.springframework.core.convert.converter.Converter<T,?> itemToParameterConverter)
Set a converter that converting item to parameter object.MyBatisBatchItemWriterBuilder<T>
sqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
Set theSqlSessionFactory
to be used by writer for database access.MyBatisBatchItemWriterBuilder<T>
sqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate)
Set theSqlSessionTemplate
to be used by writer for database access.MyBatisBatchItemWriterBuilder<T>
statementId(String statementId)
Set the statement id identifying the statement in the SqlMap configuration file.
-
Constructor Details
-
MyBatisBatchItemWriterBuilder
public MyBatisBatchItemWriterBuilder()
-
-
Method Details
-
sqlSessionTemplate
Set theSqlSessionTemplate
to be used by writer for database access.- Parameters:
sqlSessionTemplate
- theSqlSessionTemplate
to be used by writer for database access- Returns:
- this instance for method chaining
- See Also:
MyBatisBatchItemWriter.setSqlSessionTemplate(SqlSessionTemplate)
-
sqlSessionFactory
public MyBatisBatchItemWriterBuilder<T> sqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)Set theSqlSessionFactory
to be used by writer for database access.- Parameters:
sqlSessionFactory
- theSqlSessionFactory
to be used by writer for database access- Returns:
- this instance for method chaining
- See Also:
MyBatisBatchItemWriter.setSqlSessionFactory(SqlSessionFactory)
-
statementId
Set the statement id identifying the statement in the SqlMap configuration file.- Parameters:
statementId
- the id for the statement- Returns:
- this instance for method chaining
- See Also:
MyBatisBatchItemWriter.setStatementId(String)
-
assertUpdates
The flag that determines whether an assertion is made that all items cause at least one row to be updated.- Parameters:
assertUpdates
- the flag to set. Defaults to true- Returns:
- this instance for method chaining
- See Also:
MyBatisBatchItemWriter.setAssertUpdates(boolean)
-
itemToParameterConverter
public MyBatisBatchItemWriterBuilder<T> itemToParameterConverter(org.springframework.core.convert.converter.Converter<T,?> itemToParameterConverter)Set a converter that converting item to parameter object.- Parameters:
itemToParameterConverter
- a converter that converting item to parameter object- Returns:
- this instance for method chaining
- See Also:
MyBatisBatchItemWriter.setItemToParameterConverter(Converter)
-
build
Returns a fully builtMyBatisBatchItemWriter
.- Returns:
- the writer
-