Skip to content

Conversation

@leesewon00
Copy link
Member

@leesewon00 leesewon00 commented Aug 1, 2024

관련 이슈

작업 내용

  • ERD 설계안에 따라서 커뮤니티 관련 엔티티 정의하였습니다.
  • 커뮤니티 관련 테이블 존재 여부 테스트 추가하였습니다.
  • 로컬 DB에서 테이블 생성 확인하였습니다.
image image

특이 사항

게시글에서 fk로 들고있던 게시판 키가 board_id, bigint로 되어있어서
board_code, varchar(20)으로 수정하였습니다.
image

리뷰 요구사항 (선택)

@leesewon00 leesewon00 self-assigned this Aug 1, 2024
@leesewon00 leesewon00 requested review from nayonsoso and wibaek and removed request for nayonsoso and wibaek August 1, 2024 04:59
Copy link
Collaborator

@nayonsoso nayonsoso left a comment

Choose a reason for hiding this comment

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

엔티티 잘 작성하셨네요!
그런데 전체적으로 파일 끝에 개행이 되어있지 않은데
개행 추가해주면 좋을 것 같아요~
https://hyeon9mak.github.io/github-no-newline-at-a-end-of-file/

Comment on lines +14 to +17
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Board {
Copy link
Collaborator

Choose a reason for hiding this comment

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

💭 이것은 그냥 이전 코드에 대한 설명.. 반영하실 필요는 전혀 없습니다

빌더 패턴을 사용하셨네요! 지금 이전의 엔티티들을 보면 빌더 페턴을 사용하고 있지 않아서 이유를 말씀드려야 할 것 같아요.

저는 개인적으로 직접 생성자를 만들어주는 편이에요. 빌더 패턴은 인자를 명시적으로 전달할 수 있다는 점은 정말 편리하다고 생각하지만, 누락하는 인자가 있을 수 있다는 점이 치명적이라는 생각을 했어요. 그래서 이전 코드에서는 생성자를 만들어주었어요.

Copy link
Member Author

Choose a reason for hiding this comment

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

해당부분은 인지하고 있습니다!
추가적인 생성자를 생성하지않고, 유연하게 대처할 수 있어서 주로 사용하였는데,
추후 리팩토링 단계에서 추가적인 생성자 사용을 고려해보도록 하겠습니다.

Comment on lines 18 to 23
@DynamicUpdate
@DynamicInsert
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Comment extends BaseEntity {
Copy link
Collaborator

Choose a reason for hiding this comment

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

단순 궁금증

BaseEntity 클래스에 DynamicUpdate, DynamicInsert 어노테이션을 달아주지 않고, 그것을 상속하는 클래스에 달아준 이유가 있으신가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

ㅋ...큰 의도는 없었습니다..
BaseEntity를 상속하는 클래스들이 모두 DynamicUpdate, DynamicInsert 어노테이션을 필요로 할 것 같아서
해당 어노테이션 BaseEntity로 이동시켰습니다!
꼼꼼하게 확인해주셔서 감사합니다!

@leesewon00
Copy link
Member Author

leesewon00 commented Aug 2, 2024

엔티티 잘 작성하셨네요! 그런데 전체적으로 파일 끝에 개행이 되어있지 않은데 개행 추가해주면 좋을 것 같아요~ https://hyeon9mak.github.io/github-no-newline-at-a-end-of-file/

해당 링크 따라서 인텔리제이 설정하였고, 기존 파일에는 자동으로 개행이 추가되지는 않는 것 같더라구요,,? 일단 따로 추가하여 커밋하였습니다.

@leesewon00 leesewon00 requested a review from nayonsoso August 2, 2024 02:25
Copy link
Collaborator

@nayonsoso nayonsoso left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~~
((카톡 멘션 드렸어야 했는데 깜빡했네요🥲))

@leesewon00 leesewon00 merged commit 9b7c416 into solid-connection:main Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

커뮤니티 엔티티 정의

2 participants