Location and UseCase for AggregateItemReader

[亡魂溺海] 提交于 2020-01-07 05:45:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!