Entity에 붙일 어노테이션 (feat. @NoArgsConstructor의 access level) #43
soeunnPark
started this conversation in
General
Replies: 3 comments 1 reply
-
@Entity
@Table(name = "restaurant")
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class RestaurantEntity extends BaseTimeEntity {제가 작성했던 RestaurantEntity 클래스 내용입니다. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
공유해주신 링크 읽어봤는데 소은님 말씀대로 @entity @table @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED)만 붙이는게 더 좋은 코드인 것 같네요!! 저도 좋습니다 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@I-migi @sangwonsheep 넵! 그럼 entity에 어노테이션 붙일 때 이렇게 통일하면 좋을 것 같습니다 ! 😺 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://velog.io/@kevin_/%EB%82%B4%EA%B0%80-NoargsConstructor-access-AccessLevel.PROTECTED%EB%A5%BC-%EC%99%9C-%EC%9E%91%EC%84%B1%ED%96%88%EC%9D%84%EA%B9%8C
https://www.inflearn.com/community/questions/1179578/%ED%98%B9%EC%8B%9C-allargsconstructor-%EB%A5%BC-%EC%A7%80%EC%96%91%ED%95%98%EC%8B%9C%EB%8A%94-%EC%9D%B4%EC%9C%A0%EA%B0%80-%EB%B9%8C%EB%8D%94-%ED%8C%A8%ED%84%B4%EC%9D%84-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-%EC%9C%84%ED%95%A8%EC%9D%B8%EA%B0%80%EC%9A%94
Entity에 붙일 어노테이션을 통일하고 싶어서 여러 글을 찾아보는 중인데,
참고하면 좋을 것 같아서 공유합니다!
Entity 클래스에는 @entity @table @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) 만 붙이고
생성자 level에 @builder 붙여서 객체 생성하면 좋을 것 같은데, 다른 분들은 어떻게 생각하시는지 남겨주시면 좋을 것 같습니다 😄
Beta Was this translation helpful? Give feedback.
All reactions