Spring Batch

By | 2022년 8월 26일
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

CompositeItemWriter

답글 남기기