Package org.mybatis.spring.batch.builder
Class MyBatisBatchItemWriterBuilder<T>
java.lang.Object
org.mybatis.spring.batch.builder.MyBatisBatchItemWriterBuilder<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassertUpdates
(boolean assertUpdates) The flag that determines whether an assertion is made that all items cause at least one row to be updated.build()
Returns a fully builtMyBatisBatchItemWriter
.itemToParameterConverter
(org.springframework.core.convert.converter.Converter<T, ?> itemToParameterConverter) Set a converter that converting item to parameter object.sqlSessionFactory
(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory) Set theSqlSessionFactory
to be used by writer for database access.sqlSessionTemplate
(SqlSessionTemplate sqlSessionTemplate) Set theSqlSessionTemplate
to be used by writer for database access.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:
-
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:
-
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:
-
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:
-
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:
-
build
Returns a fully builtMyBatisBatchItemWriter
.- Returns:
- the writer
-