Package org.mybatis.spring.batch.builder
Class MyBatisPagingItemReaderBuilder<T>
java.lang.Object
org.mybatis.spring.batch.builder.MyBatisPagingItemReaderBuilder<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a fully builtMyBatisPagingItemReader
.maxItemCount
(int maxItemCount) Configure the max number of items to be read.pageSize
(int pageSize) The number of records to request per page/query.parameterValues
(Map<String, Object> parameterValues) Set the parameter values to be used for the query execution.parameterValuesSupplier
(Supplier<Map<String, Object>> parameterValuesSupplier) Set the parameter supplier to be used to get parameters for the query execution.Set the query id identifying the statement in the SqlMap configuration file.saveState
(boolean saveState) Configure if the state of theItemStreamSupport
should be persisted within theExecutionContext
for restart purposes.sqlSessionFactory
(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory) Set theSqlSessionFactory
to be used by writer for database access.
-
Constructor Details
-
MyBatisPagingItemReaderBuilder
public MyBatisPagingItemReaderBuilder()
-
-
Method Details
-
sqlSessionFactory
public MyBatisPagingItemReaderBuilder<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:
-
queryId
Set the query id identifying the statement in the SqlMap configuration file.- Parameters:
queryId
- the id for the query- Returns:
- this instance for method chaining
- See Also:
-
parameterValues
Set the parameter values to be used for the query execution.- Parameters:
parameterValues
- the parameter values to be used for the query execution- Returns:
- this instance for method chaining
- See Also:
-
parameterValuesSupplier
public MyBatisPagingItemReaderBuilder<T> parameterValuesSupplier(Supplier<Map<String, Object>> parameterValuesSupplier) Set the parameter supplier to be used to get parameters for the query execution.- Parameters:
parameterValuesSupplier
- the parameter supplier to be used to get parameters for the query execution- Returns:
- this instance for method chaining
- Since:
- 2.1.0
- See Also:
-
pageSize
The number of records to request per page/query. Defaults to 10. Must be greater than zero.- Parameters:
pageSize
- number of items- Returns:
- this instance for method chaining
- See Also:
-
saveState
Configure if the state of theItemStreamSupport
should be persisted within theExecutionContext
for restart purposes.- Parameters:
saveState
- defaults to true- Returns:
- The current instance of the builder.
- See Also:
-
maxItemCount
Configure the max number of items to be read.- Parameters:
maxItemCount
- the max items to be read- Returns:
- The current instance of the builder.
- See Also:
-
build
Returns a fully builtMyBatisPagingItemReader
.- Returns:
- the reader
-