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

[BSVR-220] HashTag, BlockTag 도메인/엔티티 추가 #148

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

EunjiShin
Copy link
Collaborator

📌 개요 (필수)

  • 경기장별 블록 필터링 기능을 위해 해시태그 관련 도메인/엔티티를 추가해요.
  • 한 블록은 여러 태그를 가질 수 있고, 태그에는 여러 블록이 포함될 수 있어요. (= 다대다)
스크린샷 2024-08-18 오후 11 08 18

🔨 작업 사항 (필수)

  • HashTag, BlockTag 도메인 추가
  • HashTagEntity, BlockTagEntity 추가
  • 관련 테스트코드 추가
  • jpaRepository 추가

🌱 연관 내용 (선택)

  • DB에 테이블은 미리 생성해뒀어요. ref)

💻 실행 화면 (필수)

스크린샷 2024-08-18 오후 11 11 50 local에서 hibernate.ddl-auto=validate로 했을 때 잘 돌아감~

@EunjiShin EunjiShin self-assigned this Aug 18, 2024
@EunjiShin EunjiShin added the 📂 Database DB 관련 (엔티티, 스키마, data.sql 등등,,,) label Aug 18, 2024
Copy link

github-actions bot commented Aug 18, 2024

Test Results

40 tests  +2   40 ✅ +2   0s ⏱️ ±0s
15 suites +1    0 💤 ±0 
15 files   +1    0 ❌ ±0 

Results for commit 7f19d5d. ± Comparison against base commit 4640284.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@pminsung12 pminsung12 left a 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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

protected로 바꾼 이유가 뭔지 궁금합니다~!

Copy link
Collaborator Author

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는 변경할 수 없음 )

Copy link
Member

@wjdwnsdnjs13 wjdwnsdnjs13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@EunjiShin EunjiShin merged commit 016f677 into main Aug 19, 2024
5 checks passed
@EunjiShin EunjiShin deleted the feat/BSVR-220 branch August 19, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📂 Database DB 관련 (엔티티, 스키마, data.sql 등등,,,) size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants