Skip to content

한지원 1주차 과제 #4

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nowijnah
Copy link

테이블 설명

Screenshot 2024-09-28 at 2 40 36 PM


@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long user_id;
Copy link
Member

@jjunhub jjunhub Oct 1, 2024

Choose a reason for hiding this comment

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

Suggested change
private Long user_id;
private Long userId;

디테일하게 필드 명 적어주신 부분 좋습니다!
다만 자바에서는 이러한 필드명은 대부분 CamelCase로 작성하는 것을 권장하고 있습니다.
이렇게 CamelCase로 작성한 필드들에 대해서는 jpa를 통해 MySQL로 전달될 때 snake_case로 자동으로 변경됩니다.
ex) JAVA : userId -> JPA -> MySQL : user_id

각 표기법에 대한 내용은 아래 링크 참조하시면 될 것 같습니다.
참고 링크

@jjunhub
Copy link
Member

jjunhub commented Oct 1, 2024

1주차 과제 고생하셨습니다! 👍
다음에 엔티티 작성하실 때는, Test 코드도 함께 작성해보시면 더욱 좋을 것 같습니다!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants