简体   繁体   中英

JSR352 - Single item read, multiple item write

In a project I'm working on we are reading a file in which every item (a record) read represents a variable number of items to be written in a destination database. This apparently seems to break the pattern of JSR352 by inflating a single chunk more than expected.

Does anyone has ever experienced this kind of problem? If yes, how has it been solved?

You can have a container object to hold all sub-items expanded from the single record in the input source. And the accumulated list of container objects will be passed to the item writer to write out to destination. You have full control of how the item writer works by implementing your own item writer class. For instance, the item writer class can write multiple records into destination.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM