-
Notifications
You must be signed in to change notification settings - Fork 3
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
[refactor] contents 기초 코드 수정 #10
Conversation
Content: NoArgsConstructor AccessLevel 설정 User: user_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.
수고하셨습니다!
@Colum
어노테이션의 name은 필드에 선언한 변수명과 테이블에 설정해놓은 이름이 다를 경우 사용됩니다!
카멜 케이스는 알아서 스네이크 케이스로 변환되기 때문에 name을 따로 명시해줄 필요는 없습니다 😊
private String title; | ||
|
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.
37라인부터 43라인까지 공백은 없어도 괜찮은거 같아요 ~!
public class User { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.UUID) | ||
@Column(name = "userId", nullable = false) | ||
@Column(name = "user_Id", nullable = false) |
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.
user_Id -> user_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.
반영했습니다.
@EntityListeners(AuditingEntityListener.class) | ||
public class Content { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.SEQUENCE) | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "content_id", nullable = false) |
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.
테이블의 pk를 content_id라고 설정해 놓으셨나요? id라고 설정해 놓으셨으면 name은 따로 작성 안하셔도 돼요!
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.
네 DB 모델링 할 때 content_id로 했었습니다.
@Column(name = "content_id", nullable = false) | ||
private Long id; | ||
|
||
@Column(name = "like_count") |
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.
카멜 케이스는 알아서 스네이크 케이스로 변경되기 때문에 어노테이션 따로 작성 안하셔도 괜찮습니다!
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.
확인했습니다! 수정 사항 반영 감사합니다!
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.
공백라인만 제거해서 반영해주시면 좋을 것 같습니다! 수고하셨습니다 ~~ 😊
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.
고생많으셨습니다!
@Table(name="contents") | ||
@NoArgsConstructor | ||
@Table(name = "contents") | ||
@NoArgsConstructor(access = AccessLevel.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.
이전 PR에서 제안한 의견 반영해 주신거 확인했습니다!
Issue
PR 타입(하나 이상의 PR 타입을 선택해주세요)
반영 브랜치
feat/contents_entity -> dev
변경 사항
코드 리뷰 반영하여 코드 수정