BATCH-316: Continued work on the Jdbc ItemReader documentation. Mostly additions to the DrivingQuery section.

This commit is contained in:
lucasward
2008-03-10 21:31:16 +00:00
parent f032e68efb
commit 96343035ef
8 changed files with 22 additions and 14 deletions

View File

@@ -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);
}
}
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);