Package org.mybatis.spring.batch
Class MyBatisCursorItemReader<T>
java.lang.Object
org.springframework.batch.item.ItemStreamSupport
org.springframework.batch.item.support.AbstractItemStreamItemReader<T>
org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>
org.mybatis.spring.batch.MyBatisCursorItemReader<T>
- All Implemented Interfaces:
org.springframework.batch.item.ItemReader<T>
,org.springframework.batch.item.ItemStream
,org.springframework.batch.item.ItemStreamReader<T>
,org.springframework.beans.factory.InitializingBean
public class MyBatisCursorItemReader<T>
extends org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>
implements org.springframework.beans.factory.InitializingBean
- Author:
- Guillaume Darmont / [email protected]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check mandatory properties.protected void
doClose()
protected void
doOpen()
protected T
doRead()
void
setParameterValues
(Map<String, Object> parameterValues) The parameter values to be used for the query execution.void
setParameterValuesSupplier
(Supplier<Map<String, Object>> parameterValuesSupplier) The parameter supplier used to get parameter values for the query execution.void
setQueryId
(String queryId) Public setter for the statement id identifying the statement in the SqlMap configuration file.void
setSqlSessionFactory
(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory) Public setter forSqlSessionFactory
for injection purposes.Methods inherited from class org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader
close, getCurrentItemCount, isSaveState, jumpToItem, open, read, setCurrentItemCount, setMaxItemCount, setSaveState, update
Methods inherited from class org.springframework.batch.item.ItemStreamSupport
getExecutionContextKey, setExecutionContextName, setName
-
Constructor Details
-
MyBatisCursorItemReader
public MyBatisCursorItemReader()
-
-
Method Details
-
doRead
-
doOpen
-
doClose
-
afterPropertiesSet
Check mandatory properties.- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- See Also:
-
InitializingBean.afterPropertiesSet()
-
setSqlSessionFactory
public void setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory) Public setter forSqlSessionFactory
for injection purposes.- Parameters:
sqlSessionFactory
- a factory object for theSqlSession
.
-
setQueryId
Public setter for the statement id identifying the statement in the SqlMap configuration file.- Parameters:
queryId
- the id for the statement
-
setParameterValues
The parameter values to be used for the query execution.- Parameters:
parameterValues
- the values keyed by the parameter named used in the query string.
-
setParameterValuesSupplier
The parameter supplier used to get parameter values for the query execution.- Parameters:
parameterValuesSupplier
- the supplier used to get values keyed by the parameter named used in the query string.- Since:
- 2.1.0
-