Skip to content

refactor: 기존 정책 update 시 saveAll 호출 제거 (dirty checking 활용)#121

Merged
lpromotion merged 1 commit intoWithPeace:stagingfrom
lpromotion:staging
Jun 23, 2025
Merged

refactor: 기존 정책 update 시 saveAll 호출 제거 (dirty checking 활용)#121
lpromotion merged 1 commit intoWithPeace:stagingfrom
lpromotion:staging

Conversation

@lpromotion
Copy link
Collaborator

관련 이슈번호


작업 사항

  • 기존 정책 데이터에 대해 updateAllFieldsFrom()로 필드 변경 후 saveAll(toUpdate)를 호출하던 로직을 제거함
  • 기존 엔티티는 findAll()로 조회된 영속 상태이므로,
    필드 변경 시 JPA의 dirty checking에 의해 flush/commit 시점에 자동으로 UPDATE SQL 실행됨
  • saveAll 호출은 중복된 처리이며 실제 쿼리 실행에도 영향을 주지 않아 제거

기타 사항

- 기존 정책 데이터에 대해 `updateAllFieldsFrom()`로 필드 변경 후 `saveAll(toUpdate)`를 호출하던 로직을 제거함
- 기존 엔티티는 `findAll()`로 조회된 영속 상태이므로, 필드 변경 시 JPA의 dirty checking에 의해 flush/commit 시점에 자동으로 UPDATE SQL 실행됨
- `saveAll` 호출은 중복된 처리이며 실제 쿼리 실행에도 영향을 주지 않아 제거
@lpromotion lpromotion self-assigned this Jun 23, 2025
@lpromotion lpromotion merged commit dbd54a4 into WithPeace:staging Jun 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant