Open
Conversation
jjunhub
reviewed
Oct 1, 2024
Comment on lines
+20
to
31
| @Column(name = "군번") // 컬럼명을 지정한다. | ||
| private int id; | ||
|
|
||
| // @Column(name = "description")이 생략된 경우 필드명이 컬럼명이 된다. | ||
| @Column(name = "이름") | ||
| private String name; | ||
|
|
||
| @Column(name="부대") | ||
| private String militaryUnit; | ||
|
|
||
| @Column(name = "보직") | ||
| private String description; | ||
|
|
Member
There was a problem hiding this comment.
주제가 재밌네요ㅎㅎ..
Column명을 한국어로 작성하여도 동작은 정상적으로 하지만, 보통은 영어로 적는 편이 관례입니다.
참고하시면 될 것 같아요!
jjunhub
reviewed
Oct 1, 2024
Comment on lines
+93
to
+95
| Assertions.assertThat(result1).isNull(); | ||
| Assertions.assertThat(result2).isNotNull(); | ||
| Assertions.assertThat(result3.getName()).isEqualTo("노승현"); |
jjunhub
reviewed
Oct 2, 2024
| package doit.jpastudy2.repository; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
Member
There was a problem hiding this comment.
여기 부분 이렇게 작성하셔도 동작은 하는데, 보통은 <Entity Class 이름, 그 클래스의 PK 타입>으로 작성하는 편입니다.
jpa단에서 자동으로 int <-> Long 변환을 수행하지만, 처음부터 올바르게 적어주시는게 좋을 것 같습니다~
Suggested change
| public interface ArmyRepository extends JpaRepository<Army, int> { |
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.
군 관련 데이터베이스 테이블