private int batchSize;
private EntityAdapterDefinition definition;
private StorageObject storage;
+ private int limit;
+ private int skip;
public EntityListProducerNode(String aKey, StorageObject aStorage,
EntityAdapterDefinition aDefinition, String aWhereClause, String anOrderByClause,
- int aBatchSize, ProducerNode aSubNode) {
+ int aLimit, int aSkip, ProducerNode aSubNode) {
super(aSubNode);
storage = aStorage;
key = aKey;
whereClause = aWhereClause;
orderByClause = anOrderByClause;
- batchSize = aBatchSize;
+ limit = aLimit;
+ skip = aSkip;
}
public void produce(Map aValueMap, String aVerb, PrintWriter aLogger) throws ProducerFailure {
try {
aValueMap.put(key,
- new EntityIteratorAdapter(
- storage,
- ParameterExpander.expandExpression( aValueMap, whereClause ),
- ParameterExpander.expandExpression( aValueMap, orderByClause ),
- batchSize,
- definition )
+ new CachingRewindableIterator(
+ new EntityIteratorAdapter(
+ storage,
+ ParameterExpander.expandExpression( aValueMap, whereClause ),
+ ParameterExpander.expandExpression( aValueMap, orderByClause ),
+ 20,
+ definition,
+ limit,
+ skip )
+ )
);
super.produce(aValueMap, aVerb, aLogger);
}