问题
Appendix Here lists a reader AggregateItemReader but I am not able to find it in any of Spring Batch jar files. I am using spring batch with spring boot and have version 3.0.7.
API Doc indicates it in samples package.
Currently, I am using JdbcPagingItemReader in my project but I want reader to return a List or Collection of objects to processor instead of a single object.This is needed so I can process those objects in bulk instead of processing one by one.
Pagination requirement is mandatory so I use JdbcPagingItemReader
By reading description, it looks AggregateItemReader was the candidate but can't find its implementation.
Any Ideas? Are there any alternatives?
回答1:
The package org.springframework.batch.sample.domain.multiline containing AggregateItemReader class seems to be in the spring-batch-samples artifact; this should be also imported into your project separately from spring-batch-core. E.g. in maven pom.xml the following dependency resolves the issue
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-samples</artifactId>
<version>3.0.0.M3</version>
</dependency>
来源:https://stackoverflow.com/questions/39848744/location-and-usecase-for-aggregateitemreader