|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Log |
logger
|
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()
|
int |
getPage()
The current page number. |
int |
getPageSize()
The page size configured for this reader. |
protected void |
jumpToItem(int itemIndex)
Move to the given item index. |
void |
setPageSize(int pageSize)
The number of rows to retrieve at a time. |
Methods inherited from class org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader |
---|
close, getCurrentItemCount, getExecutionContextUserSupport, isSaveState, 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 volatile List<T> results
Constructor Detail |
---|
public AbstractPagingItemReader()
Method Detail |
---|
public int getPage()
public int getPageSize()
public void setPageSize(int pageSize)
pageSize
- the number of rows to fetch per pagepublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
InitializingBean.afterPropertiesSet()
protected T doRead() throws Exception
AbstractItemCountingItemStreamItemReader
doRead
in class AbstractItemCountingItemStreamItemReader<T>
Exception
protected abstract void doReadPage()
protected void doOpen() throws Exception
AbstractItemCountingItemStreamItemReader
doOpen
in class AbstractItemCountingItemStreamItemReader<T>
Exception
protected void doClose() throws Exception
AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader.doOpen()
.
doClose
in class AbstractItemCountingItemStreamItemReader<T>
Exception
protected void jumpToItem(int itemIndex) throws Exception
AbstractItemCountingItemStreamItemReader
AbstractItemCountingItemStreamItemReader.doRead()
.
jumpToItem
in class AbstractItemCountingItemStreamItemReader<T>
Exception
protected abstract void doJumpToPage(int itemIndex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |