Conversation
ggamnunq
reviewed
Oct 30, 2025
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; //pk | ||
| private Long memberId; //pk |
There was a problem hiding this comment.
private Long id; -> 이렇게 해도 member_id로 컬럼 이름 저장됩니다.
private Long memberId => 이렇게 하면 CammelCase -> snake_case로 자동 변환돼서 member_id로 저장됩니다.
∴ 그냥 id로 저장해도 된다~
ggamnunq
reviewed
Oct 30, 2025
| //2 id 로 멤버 테이블 조회 | ||
| //마이 페이지 화면 쿼리 | ||
| //(메서드 생성 방식 권장) | ||
| Optional<Member> findById(Long id); |
ggamnunq
reviewed
Oct 30, 2025
| JOIN FETCH r.subRegion sr | ||
| WHERE r.id = :regionId | ||
| """, | ||
| countQuery = "SELECT count(m) FROM Mission m JOIN m.store s WHERE s.region.id = :regionId") |
There was a problem hiding this comment.
countQuery -> 이게 뭔가 해서 알아봤는데, fetchJoin + Page 하면 CountQuery를 정상적으로 만들지 못한다는걸 배웠네요. 굿굿
ggamnunq
reviewed
Oct 30, 2025
| show-sql: true # | ||
| hibernate: | ||
| ddl-auto: create # | ||
| ddl-auto: create-drop # |
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.
5주차 : JPA 활용 미션