-
Notifications
You must be signed in to change notification settings - Fork 0
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
[BSVR-220] HashTag, BlockTag 도메인/엔티티 추가 #148
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@@ -62,7 +62,7 @@ public boolean isDeleted() { | |||
return this.deletedAt != null; | |||
} | |||
|
|||
public void setId(Long id) { | |||
protected void setId(Long id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected로 바꾼 이유가 뭔지 궁금합니다~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setId()가 최대한 해당하는 entity 내부에서만 쓰이길 바랬어!
Id는 절대 바뀌면 안되는 값이고, 따라서 아무데서나 setId()가 의도치않게 호출되지 않도록 제어해야해. 어디서 수정 가능성이 열려있는지도 파악할 수 있어야 하고! setId() 자체를 두지 않는 것이 베스트겠지만 우리는 ReviewImage 등에서 어쩔 수 없이 사용 중이므로....
차선책으로 BaseEntity를 상속하는 클래스들, 즉 Entity 클래스 내부에서만 쓸 수 있도록 접근 레벨을 높였어.
그럼 적어도 Id 관련 변경은 해당 entity 클래스 내에서만 일어날 테니까 변경 책임을 줄일 수 있다고 판단했슴니당
(e.g., ReviewImageEntity 내부에서는 ReviewImageEntity의 Id만 변경 가능! Review의 Id는 변경할 수 없음 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
📌 개요 (필수)
🔨 작업 사항 (필수)
🌱 연관 내용 (선택)
💻 실행 화면 (필수)