Table of Contents
Spring Batch
페이징 오류 해결
@StepScope
public RepositoryItemReader<SrcItemEntity> readForInsert() {
RepositoryItemReader<SrcItemEntity> repositoryItemReader = new RepositoryItemReader<>() {
// 참조 : https://jojoldu.tistory.com/337
@Override
protected SrcItemEntity doRead() throws Exception {
super.jumpToItem(0);
return super.doRead();
}
};
// RepositoryItemReader<SrcItemEntity> repositoryItemReader = new RepositoryItemReader<>();
repositoryItemReader.setRepository(srcItemRepository);
repositoryItemReader.setMethodName("findNeedTransferInsertList");
repositoryItemReader.setPageSize(readProduct);
repositoryItemReader.setSort(sorts);
return repositoryItemReader;
}
마이그래이션
how-to-read-from-multiple-repositoryitemreaders-and-write-into-one-repositoryite