Package org.mybatis.spring.batch.builder
Class MyBatisCursorItemReaderBuilder<T>
- java.lang.Object
-
- org.mybatis.spring.batch.builder.MyBatisCursorItemReaderBuilder<T>
-
public class MyBatisCursorItemReaderBuilder<T> extends java.lang.ObjectA builder for theMyBatisCursorItemReader.- Since:
- 2.0.0
- Author:
- Kazuki Shimizu
- See Also:
MyBatisCursorItemReader
-
-
Constructor Summary
Constructors Constructor Description MyBatisCursorItemReaderBuilder()
-
Method Summary
Modifier and Type Method Description MyBatisCursorItemReader<T>build()Returns a fully builtMyBatisCursorItemReader.MyBatisCursorItemReaderBuilder<T>maxItemCount(int maxItemCount)Configure the max number of items to be read.MyBatisCursorItemReaderBuilder<T>parameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)Set the parameter values to be used for the query execution.MyBatisCursorItemReaderBuilder<T>queryId(java.lang.String queryId)Set the query id identifying the statement in the SqlMap configuration file.MyBatisCursorItemReaderBuilder<T>saveState(boolean saveState)Configure if the state of theItemStreamSupportshould be persisted within theExecutionContextfor restart purposes.MyBatisCursorItemReaderBuilder<T>sqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)Set theSqlSessionFactoryto be used by reader for database access.
-
-
-
Method Detail
-
sqlSessionFactory
public MyBatisCursorItemReaderBuilder<T> sqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
Set theSqlSessionFactoryto be used by reader for database access.- Parameters:
sqlSessionFactory- theSqlSessionFactoryto be used by writer for database access- Returns:
- this instance for method chaining
- See Also:
MyBatisCursorItemReader.setSqlSessionFactory(SqlSessionFactory)
-
queryId
public MyBatisCursorItemReaderBuilder<T> queryId(java.lang.String 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:
MyBatisCursorItemReader.setQueryId(String)
-
parameterValues
public MyBatisCursorItemReaderBuilder<T> parameterValues(java.util.Map<java.lang.String,java.lang.Object> 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:
MyBatisCursorItemReader.setParameterValues(Map)
-
saveState
public MyBatisCursorItemReaderBuilder<T> saveState(boolean saveState)
Configure if the state of theItemStreamSupportshould be persisted within theExecutionContextfor restart purposes.- Parameters:
saveState- defaults to true- Returns:
- The current instance of the builder.
- See Also:
AbstractItemCountingItemStreamItemReader.setSaveState(boolean)
-
maxItemCount
public MyBatisCursorItemReaderBuilder<T> maxItemCount(int 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:
AbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
-
build
public MyBatisCursorItemReader<T> build()
Returns a fully builtMyBatisCursorItemReader.- Returns:
- the reader
-
-