Open
Conversation
|
왜 반말이야? |
Author
ㅋㅋ 귀찮잖아~ |
jjunhub
reviewed
Oct 8, 2024
Comment on lines
+19
to
+28
| @Column(name = "prof_id") // 컬럼명을 지정한다. | ||
| private Long id; | ||
|
|
||
| // @Column(name = "type")이 생략된 경우 필드명이 컬럼명이 된다. snake_case로 변환된다. | ||
| @Column(name = "prof_name") | ||
| private String name; | ||
|
|
||
| // @Column(name = "description")이 생략된 경우 필드명이 컬럼명이 된다. | ||
| @Column(name = "prof_email") | ||
| private String email; |
Member
There was a problem hiding this comment.
좋습니다!
진짜 예전에는 MySQL 용량 차지한다고 DB Column 이름을 줄여서 사용하곤 했는데, 요즘은 그냥 이름 길게길게 사용하는게 일반적이라고 하더라구요. 물론 이건 어디나 프로젝트 바이 프로젝트이니, 참고만 하시면 될 것 같습니다
jjunhub
reviewed
Oct 8, 2024
Comment on lines
+6
to
+7
| Professor findByEmail(String email); | ||
| Professor findByName(String name); |
Member
There was a problem hiding this comment.
규칙 지켜서 잘 작성해주셨습니다!
Professor findByProfId(Long id);
위의 쿼리 메소드와 비교해서, 이 메소드에 대해서 항상 유일하게 Professor 개체가 1개만 나오는가?를 고려해보신 뒤에
다음과 같은 사항을 고민해보시는 것도 좋을 것 같습니다.
- 어떻게 이를 변경하면 좋을지
- 언제가 항상 1개이고, 언제가 여러 개일수 있는 경우인지
Member
|
전반적으로 깔끔하게 잘 작성해주셨습니다!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
테이블 설명
교수님(M)들과 수강과목(N)들의 관계
교수 테이블
교수_id <- PK
과목 테이블
과목_id <- PK
교수 <-> 과목
교수_id, 과목_id <- FK(M:N)
아쉬운 점
학점도 다른 테이블로 빼야할 것 같지만??? 귀ㅣ찮습니다
아직... 교수 테이블밖에 안 만들었ㄴㄴ데 힘 좀 써보고 다시 돌아와볼ㄹ게ㅕ