Spring Batch read from db write to different files by records

102 Views Asked by At

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.

0

There are 0 best solutions below