dandelion
dandelion

Reputation: 15

Spring Batch read from db write to different files by records

I am trying to read from db with records like one header and many related details, then I have to output to different file by the composite key of headers. For example, table countries(header) with columns: country_id, name, area table country_stats(detail) with columns: country_id, year, population, gdp

how to assgin every header+details to different file? Using ClassifierCompositeItemWriter with delegating to a list of FlatFileItemWriter? If it could be used, how I assign resource to every FlatFileItemWriter at runtime?

Please give me some hints.

Upvotes: 0

Views: 122

Answers (0)

Related Questions