-
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
도메인 구조를 리패키징하고 래핑했습니다. #1
base: main
Are you sure you want to change the base?
Conversation
LGTM |
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.
우선 궁금한 것 위주로 리뷰를 달아봤씀당 Diger!
어떤 의도인지 알겠구 좋은 의도라구 판단합니당!
근데 클래스가 너무 많아지는 것에 대해서는 어떻게 생각하는지 궁금하구
지금 당장 필요하지 않는다면 굳이 써야할까? (YAGNI 원칙)라는 생각이 들어서 의견이 궁금합니다
갠적으로 상관없다고는 생각하지만 고려해보는 것도 좋을 것 같아서 남겨봅니다 ㅎㅎ
@@ -11,12 +11,16 @@ import java.time.LocalDateTime | |||
abstract class BaseEntity { | |||
@Id | |||
@GeneratedValue(strategy = GenerationType.IDENTITY) | |||
val id: Long? = null | |||
val id: Long = 0L |
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.
이거 안그래도 궁금했던 부분 중 하나..!
JPA에서 Wrapper 타입을 사용하는건 0과 같은 값이 ID일 때 유효한가?에 대한 판단을 위해서인데
이렇게 0을 써도 무방해 부라더?? 잘 모르겠움 😭
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.
auto increment는 GenerationType.IDENTITY옵션을 쓰면 전적으로 DBMS가 부여하는 PK를 쓰는걸로 알고있어서 기본값을 0L로 지정해도 무관하다고 알고있어요!
물론 형이 하신대로 하셔도 진짜 노상관이라서 이것도 굳이 반영안하고 형 생각대로 가도 될 것 같아요!
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.
몰라서 물어본거라 편하게 정해도 좋습니다 ㅋㅋ
val id: Long? = null | ||
val id: Long = 0L | ||
|
||
@Column(name = "is_deleted") |
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.
name을 딱히 매핑해주지 않아도 자동으로 snake_case로 변환해주는데 굳이 붙인 이유가 있을까??
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.
하다가 빼먹은 컬럼이 많긴하지만 명시적으로 컬럼을 네이밍하는게 조금 더 보기 좋은 것 같긴해서 써놨어요~
이것도 컨벤션 정해놓으면 좋을것같네요?!
클래스 홍수가 나는건 확실히 좀 복잡해질 순 있긴하겠네요 요고는 회의때 함 말해보는걸로 할까유?! |
44537c7
to
53ea77a
Compare
6f8f71b
to
a1951e2
Compare
70f7fd8
to
ec9aa7b
Compare
기존 문제점
해결 방법
Title
이라는 컬럼이 필요하다면 Title이라는 임베디드 타입을 생성하여 자체적으로 그에 대한 값을 검증하는 도메인 로직을 가질 수 있도록 하였고다른 객체와 상호작용하여 특정 컬럼에 대한 로직을 처리할 수 있도록 구조를 마련했습니다.
추가로 공유할 점
리뷰 시원하게 남겨주세요 ^^