refactor: 기존 정책 update 시 saveAll 호출 제거 (dirty checking 활용)#121
Merged
lpromotion merged 1 commit intoWithPeace:stagingfrom Jun 23, 2025
Merged
refactor: 기존 정책 update 시 saveAll 호출 제거 (dirty checking 활용)#121lpromotion merged 1 commit intoWithPeace:stagingfrom
lpromotion merged 1 commit intoWithPeace:stagingfrom
Conversation
- 기존 정책 데이터에 대해 `updateAllFieldsFrom()`로 필드 변경 후 `saveAll(toUpdate)`를 호출하던 로직을 제거함 - 기존 엔티티는 `findAll()`로 조회된 영속 상태이므로, 필드 변경 시 JPA의 dirty checking에 의해 flush/commit 시점에 자동으로 UPDATE SQL 실행됨 - `saveAll` 호출은 중복된 처리이며 실제 쿼리 실행에도 영향을 주지 않아 제거
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈번호
작업 사항
updateAllFieldsFrom()로 필드 변경 후saveAll(toUpdate)를 호출하던 로직을 제거함findAll()로 조회된 영속 상태이므로,필드 변경 시 JPA의 dirty checking에 의해 flush/commit 시점에 자동으로 UPDATE SQL 실행됨
saveAll호출은 중복된 처리이며 실제 쿼리 실행에도 영향을 주지 않아 제거기타 사항