[fix] JPA 엔티티 동일성(EqualsAndHashCode) 및 영속성 관련 버그 수정#150
Merged
saokiritoni merged 2 commits intodevelopfrom Nov 5, 2025
Merged
Conversation
kwdahun
approved these changes
Sep 30, 2025
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.
🌱 관련 이슈
🌱 작업 사항
Could not set value... (setter)에러를 수정합니다!🌱 참고 사항
🤔 기존 @EqualsAndHashCode 사용 이유
🐞 에러 원인 분석
@GeneratedValue ID를 기준으로 한 불안정한 hashCode: 자동 생성되는 ID를 기준으로 구현하면서 에러 발생
성급한 flush() 호출로 인한 생명주기 충돌
🔧 수정사항
🔗 참고
https://velog.io/@nmrhtn7898/JPA-Entity%EC%97%90%EC%84%9C-equals-hashcode-%EC%82%AC%EC%9A%A9%EC%8B%9C-%EB%B0%9C%EC%83%9D%ED%95%A0-%EC%88%98-%EC%9E%88%EB%8A%94-%EB%AC%B8%EC%A0%9C%EC%A0%90
Set을 사용하면 List보다 논리적 & 성능적으로 좋지만