Skip to content

[4기 김영주, 소재훈] JPA Mission 3 - 연관관계매핑(order, order_item, item의 연관관계 매핑 실습)#326

Open
jay-so wants to merge 11 commits into영주,재훈-missionfrom
영주,재훈-mission-3

Hidden character warning

The head ref may contain hidden characters: "\uc601\uc8fc,\uc7ac\ud6c8-mission-3"
Open

[4기 김영주, 소재훈] JPA Mission 3 - 연관관계매핑(order, order_item, item의 연관관계 매핑 실습)#326
jay-so wants to merge 11 commits into영주,재훈-missionfrom
영주,재훈-mission-3

Conversation

@jay-so
Copy link
Copy Markdown
Member

@jay-so jay-so commented Aug 3, 2023

👩‍💻 요구 사항과 구현 내용

order, order_item, item의 연관관계 매핑 실습

  • Member와 Order의 1:N의 양방향의 연관관계
  • Order와 OrderItem의 1:N의 양방향의 연관관계 매핑
  • Member CRUD 구현

@jay-so jay-so requested review from Hchanghyeon and charlesuu August 3, 2023 16:13
@jay-so jay-so marked this pull request as ready for review August 3, 2023 16:13
Copy link
Copy Markdown
Member

@Hchanghyeon Hchanghyeon left a comment

Choose a reason for hiding this comment

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

영주님, 재훈님~ 너무 깔끔하게 잘해주셔서 리뷰할게 많지 않았던 것 같아요!

리뷰 달아놓았으니 확인 한 번만 부탁드리겠습니다! 🙏🙏🙏

감사합니다~!

Comment on lines +32 to +37
public ResponseDto findById(Long id) {
Member member = memberRepository.findById(id)
.orElseThrow(() -> new NoSuchElementException("해당 고객이 존재하지 않습니다."));

return ResponseDto.fromEntity(member);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

현재 조회 메소드 들에 대해서는 따로 @Transactional(readOnly = true)를 적어주시지 않았는데 따로 이유가 있으실까요?

제가 알기로는 find해서 가져오는 것에는 문제가 없으나 OSIV를 끄고 Member안에 있는 다른 객체의 값을 가져올 때 Lazy Loading이 되지않아 정상적인 동작을 할 수 없는 경우도 있다고 보았습니다!

참고 사항

package com.programmers.springbootjpa.entity;

public enum OrderStatus {
ACCEPTED, CANCELED, DELIVERED
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

문자열 상수로만 이루어져있다해도 한 칸씩 개행해주는 것이 더 가독성에 좋을 것 같다고 생각이 드는데 어떻게 생각하시나요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants