|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.item.ExecutionContextUserSupport org.springframework.batch.item.database.support.IbatisKeyCollector
public class IbatisKeyCollector
KeyCollector
based on iBATIS ORM framework. It is functionally
similar to SingleColumnJdbcKeyCollector
but does not make assumptions
about the primary key structure. A separate restart query is necessary to
ensure that only the required keys remaining for processing are returned, rather
than the entire original list.
DrivingQueryItemReader
Constructor Summary | |
---|---|
IbatisKeyCollector()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
SqlMapClientTemplate |
getSqlMapClientTemplate()
|
List |
retrieveKeys(ExecutionContext executionContext)
Retrieve the keys to be iterated over. |
void |
setDrivingQueryId(String drivingQueryId)
|
void |
setRestartQueryId(String restartQueryId)
Set the id of the restart query. |
void |
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
|
void |
updateContext(Object key,
ExecutionContext executionContext)
Given the provided key, store it in the provided ExecutionContext. |
Methods inherited from class org.springframework.batch.item.ExecutionContextUserSupport |
---|
getKey, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IbatisKeyCollector()
Method Detail |
---|
public List retrieveKeys(ExecutionContext executionContext)
KeyCollector
Retrieve the keys to be iterated over. If the ExecutionContext provided includes any state relevant to this collector (because it was stored as part of saveState()) then it should start from the point indicated by that state.
In the case of a restart, (i.e. the ExecutionContext contains relevant state) this method should return only the keys that are remaining to be processed. For example, if the are 1,000 keys, and the 500th is processed before the batch job terminates unexpectedly, upon restart keys 501 through 1,000 should be returned.
retrieveKeys
in interface KeyCollector
executionContext
- ExecutionContext containing any potential initial state
that could potentially be used to retrieve the correct keys.
public void updateContext(Object key, ExecutionContext executionContext)
KeyCollector
DrivingQueryItemReader
doing it
for all KeyCollector implementations.
updateContext
in interface KeyCollector
key
- to be converted to restart data.public void afterPropertiesSet() throws Exception
Exception
public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
sqlMapClient
- configured iBATIS clientpublic void setDrivingQueryId(String drivingQueryId)
drivingQueryId
- id of the iBATIS select statement that will be used
to retrieve the list of primary keyspublic void setRestartQueryId(String restartQueryId)
restartQueryId
- id of the iBatis select statement that will be used
to retrieve the list of primary keys after a restart.public final SqlMapClientTemplate getSqlMapClientTemplate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |