Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] Refactor/#430 핀 복사 시 JdbcTemplate을 이용하여 bulk insert하도록 변경 #617

Merged
merged 25 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ca47a30
feat: batch update 적용 중
yoondgu Oct 18, 2023
11f64ff
chore: batch update 적용 중
yoondgu Oct 18, 2023
331db76
feat: pin image를 고려한 batch update 적용
yoondgu Oct 24, 2023
2486358
feat: batch update 시 pinImage N+1 문제 해결을 위한 fetch join
yoondgu Oct 26, 2023
79dcbce
refactor: PinBatchRepository 중복 제거 및 메서드 분리
yoondgu Oct 26, 2023
12ab047
refactor: jdbcTemplate 사용하는 리포지토리를 사용자 정의 리포지토리로 추상화
yoondgu Oct 31, 2023
974de2b
refactor: PinBatchRepository 인덴트 개선
yoondgu Oct 31, 2023
5186cc8
refactor: 테스트 컨테이너 jdbcURl에 batch update를 위한 설정 추가
yoondgu Oct 31, 2023
e6a30ba
refactor: saveAllToTopic 불필요한 인자 제거로 인한 시그니처 변경
yoondgu Nov 1, 2023
60cab90
refactor: 사용자 정의 리포지토리의 saveAllToTopic 테스트 작성
yoondgu Nov 1, 2023
dc9a5b7
refactor: jdbcTemplate, hibernate 중복 로그 하는 대신 커스텀 로그 설정
yoondgu Nov 1, 2023
f907795
test: 테스트 내 불필요한 출력 삭제
yoondgu Nov 1, 2023
26db14d
test: JPA 쿼리 호출과 JdbcTemplate 쿼리 호출 분리
yoondgu Nov 1, 2023
585e135
chore: batch update를 위한 jdbc url 설정 추가
yoondgu Nov 1, 2023
7512b63
chore: 로컬 환경 batch update 설정 추가
yoondgu Nov 1, 2023
0073ed2
refactor: 불필요한 flush 삭제
yoondgu Nov 1, 2023
a57a16c
refactor: 개행 추가
yoondgu Nov 1, 2023
de403b5
chore: 커스텀 리포지토리 패키지 컨텍스트 별로 변경
yoondgu Nov 2, 2023
58fc4ea
refactor: 메서드명 수정 및 가독성 개선
yoondgu Nov 2, 2023
ab519fb
refactor: 불필요한 flush 삭제
yoondgu Nov 3, 2023
eabc420
refactor: rowCount 상태코드 상수화
yoondgu Nov 3, 2023
bd7f38c
refactor: sql 문자열 개행 방식 수정
yoondgu Nov 3, 2023
6976452
refactor: DB용 Dto record로 변경
yoondgu Nov 3, 2023
bda1f24
refactor: 사용하지 않는 메서드 삭제
yoondgu Nov 3, 2023
986ffb1
refactor: 불필요한 update 호출 삭제
yoondgu Nov 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.mapbefine.mapbefine.pin.infrastructure;

import static java.sql.Statement.EXECUTE_FAILED;

import com.mapbefine.mapbefine.pin.domain.Pin;
import com.mapbefine.mapbefine.pin.domain.PinImage;
import com.mapbefine.mapbefine.topic.domain.Topic;
Expand Down Expand Up @@ -78,7 +80,7 @@ private List<PinImageInsertDto> createPinImageInsertDtos(List<Pin> originalPins,
validateId(firstIdFromBatch);

return IntStream.range(0, originalPins.size())
.filter(index -> rowCount[index] != -3)
.filter(index -> rowCount[index] != EXECUTE_FAILED)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

.mapToObj(index -> {
Pin pin = originalPins.get(index);
return PinImageInsertDto.of(pin.getPinImages(), firstIdFromBatch + index);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 아주 깔끔하게 해결해주셨네요 멋집니다 도이

Expand Down