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 Constructor Description MyBatisCursorItemReader() -
Method Summary
Modifier and Type Method Description voidafterPropertiesSet()Check mandatory properties.protected voiddoClose()protected voiddoOpen()protected TdoRead()voidsetParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)The parameter values to be used for the query execution.voidsetQueryId(java.lang.String queryId)Public setter for the statement id identifying the statement in the SqlMap configuration file.voidsetSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)Public setter forSqlSessionFactoryfor injection purposes.Methods inherited from class org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader
close, getCurrentItemCount, isSaveState, jumpToItem, open, read, setCurrentItemCount, setMaxItemCount, setSaveState, updateMethods inherited from class org.springframework.batch.item.ItemStreamSupport
getExecutionContextKey, setExecutionContextName, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MyBatisCursorItemReader
public MyBatisCursorItemReader()
-
-
Method Details
-
doRead
- Specified by:
doReadin classorg.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>- Throws:
java.lang.Exception
-
doOpen
protected void doOpen() throws java.lang.Exception- Specified by:
doOpenin classorg.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>- Throws:
java.lang.Exception
-
doClose
protected void doClose() throws java.lang.Exception- Specified by:
doClosein classorg.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>- Throws:
java.lang.Exception
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.ExceptionCheck mandatory properties.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception- See Also:
InitializingBean.afterPropertiesSet()
-
setSqlSessionFactory
public void setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)Public setter forSqlSessionFactoryfor injection purposes.- Parameters:
sqlSessionFactory- a factory object for theSqlSession.
-
setQueryId
public void setQueryId(java.lang.String queryId)Public setter for the statement id identifying the statement in the SqlMap configuration file.- Parameters:
queryId- the id for the statement
-
setParameterValues
public void setParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)The parameter values to be used for the query execution.- Parameters:
parameterValues- the values keyed by the parameter named used in the query string.
-