public class MyBatisPagingItemReader<T>
extends org.springframework.batch.item.database.AbstractPagingItemReader<T>
org.springframework.batch.item.ItemReader
for reading database
records using MyBatis in a paging fashion.
Provided to facilitate the migration from Spring-Batch iBATIS 2 page item readers to MyBatis 3.
Constructor and Description |
---|
MyBatisPagingItemReader() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Check mandatory properties.
|
protected void |
doJumpToPage(int itemIndex) |
protected void |
doReadPage() |
void |
setParameterValues(Map<String,Object> parameterValues)
The parameter values to be used 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 for
SqlSessionFactory for injection purposes. |
doClose, doOpen, doRead, getPage, getPageSize, jumpToItem, setPageSize
close, getCurrentItemCount, isSaveState, open, read, setCurrentItemCount, setMaxItemCount, setSaveState, update
public void setSqlSessionFactory(org.apache.ibatis.session.SqlSessionFactory sqlSessionFactory)
SqlSessionFactory
for injection purposes.sqlSessionFactory
- a factory object for the SqlSession
.public void setQueryId(String queryId)
queryId
- the id for the statementpublic void setParameterValues(Map<String,Object> parameterValues)
parameterValues
- the values keyed by the parameter named used in
the query string.public void afterPropertiesSet() throws Exception
protected void doReadPage()
doReadPage
in class org.springframework.batch.item.database.AbstractPagingItemReader<T>
protected void doJumpToPage(int itemIndex)
doJumpToPage
in class org.springframework.batch.item.database.AbstractPagingItemReader<T>
Copyright © 2010–2019 MyBatis.org. All rights reserved.