|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader<T>
org.springframework.batch.item.database.AbstractPagingItemReader<T>
public abstract class AbstractPagingItemReader<T>
Abstract ItemReader for to extend when reading database records in a paging
fashion.
Implementations should execute queries using paged requests of a size specified in setPageSize(int).
Additional pages are requested when needed as AbstractItemCountingItemStreamItemReader.read() method is called, returning an
object corresponding to current position.
| Field Summary | |
|---|---|
protected int |
current
|
protected boolean |
initialized
|
protected Log |
logger
|
protected int |
page
|
protected int |
pageSize
|
protected List<T> |
results
|
| Constructor Summary | |
|---|---|
AbstractPagingItemReader()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
Check mandatory properties. |
protected void |
doClose()
Close the resources opened in AbstractItemCountingItemStreamItemReader.doOpen(). |
protected abstract void |
doJumpToPage(int itemIndex)
|
protected void |
doOpen()
Open resources necessary to start reading input. |
protected T |
doRead()
Read next item from input. |
protected abstract void |
doReadPage()
|
protected void |
jumpToItem(int itemIndex)
Move to the given item index. |
void |
setPageSize(int pageSize)
The number of rows to retreive at a time. |
| Methods inherited from class org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader |
|---|
close, getCurrentItemCount, open, read, setCurrentItemCount, setMaxItemCount, setName, setSaveState, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Log logger
protected boolean initialized
protected int current
protected int page
protected int pageSize
protected List<T> results
| Constructor Detail |
|---|
public AbstractPagingItemReader()
| Method Detail |
|---|
public void setPageSize(int pageSize)
pageSize - the number of rows to fetch per page
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionInitializingBean.afterPropertiesSet()
protected T doRead()
throws Exception
AbstractItemCountingItemStreamItemReader
doRead in class AbstractItemCountingItemStreamItemReader<T>Exceptionprotected abstract void doReadPage()
protected void doOpen()
throws Exception
AbstractItemCountingItemStreamItemReader
doOpen in class AbstractItemCountingItemStreamItemReader<T>Exception
protected void doClose()
throws Exception
AbstractItemCountingItemStreamItemReaderAbstractItemCountingItemStreamItemReader.doOpen().
doClose in class AbstractItemCountingItemStreamItemReader<T>Exception
protected void jumpToItem(int itemIndex)
throws Exception
AbstractItemCountingItemStreamItemReaderAbstractItemCountingItemStreamItemReader.doRead().
jumpToItem in class AbstractItemCountingItemStreamItemReader<T>Exceptionprotected abstract void doJumpToPage(int itemIndex)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||