BATCH-316: Continued work on the Jdbc ItemReader documentation. Mostly additions to the DrivingQuery section.
This commit is contained in:
@@ -166,7 +166,7 @@ public class DrivingQueryItemReader implements ItemReader, InitializingBean,
|
||||
if(saveState){
|
||||
Assert.notNull(executionContext, "ExecutionContext must not be null");
|
||||
if(getCurrentKey() != null){
|
||||
keyGenerator.saveState(getCurrentKey(), executionContext);
|
||||
keyGenerator.updateContext(getCurrentKey(), executionContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,5 +43,5 @@ public interface KeyCollector {
|
||||
* @throws IllegalArgumentException if key is null.
|
||||
* @throws IllegalArgumentException if key is an incompatible type.
|
||||
*/
|
||||
void saveState(Object key, ExecutionContext executionContext);
|
||||
void updateContext(Object key, ExecutionContext executionContext);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class IbatisKeyCollector extends ExecutionContextUserSupport implements K
|
||||
* (non-Javadoc)
|
||||
* @see KeyCollector#saveState(Object, ExecutionContext)
|
||||
*/
|
||||
public void saveState(Object key, ExecutionContext executionContext) {
|
||||
public void updateContext(Object key, ExecutionContext executionContext) {
|
||||
Assert.notNull(key, "Key must not be null");
|
||||
Assert.notNull(executionContext, "ExecutionContext must be null");
|
||||
executionContext.put(getKey(RESTART_KEY), key);
|
||||
|
||||
@@ -87,7 +87,7 @@ public class MultipleColumnJdbcKeyCollector implements KeyCollector {
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.batch.io.driving.KeyGenerator#getKeyAsExecutionContext(java.lang.Object)
|
||||
*/
|
||||
public void saveState(Object key, ExecutionContext executionContext) {
|
||||
public void updateContext(Object key, ExecutionContext executionContext) {
|
||||
Assert.state(keyMapper != null, "Key mapper must not be null.");
|
||||
Assert.notNull(key, "The key must not be null");
|
||||
keyMapper.mapKeys(key, executionContext);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class SingleColumnJdbcKeyCollector extends ExecutionContextUserSupport im
|
||||
* @see KeyCollector#saveState(Object)
|
||||
* @throws IllegalArgumentException if key is null.
|
||||
*/
|
||||
public void saveState(Object key, ExecutionContext executionContext) {
|
||||
public void updateContext(Object key, ExecutionContext executionContext) {
|
||||
Assert.notNull(key, "The key must not be null.");
|
||||
Assert.notNull(executionContext, "The ExecutionContext must not be null");
|
||||
executionContext.put(RESTART_KEY, key);
|
||||
|
||||
Reference in New Issue
Block a user