The write method of Itemwriter has been changed in the spring version 5.
@Override
public void write(List<? extends List<DataDTO>> items) throws Exception{
for(List<DataDTO> sublist:items){
writer.write(sublist);
}
The above writer is FlatFileItemWriter.
I changed to the following
@Override
public void write(Chunk<? extends List<DataDTO>> items) throws Exception{
for(List<DataDTO> sublist:items){
writer.write((Chunk<? extends DataDTO>)sublist);
}
}
Is this correct way of replacing/fix? need some help.
Im expecting the correct fix.
Expecting coreect replacement.
According to the Spring Batch 5.0 migration guide, most references to
Lists in the API were replaced withChunk.A good way to do the migration in your code is to use one of
Chunk's constructors.Example: