Skip to content

Conversation

@essaysir
Copy link
Contributor

ERD 에 맞게 엔티티 생성 및 수정 했습니다.
요청하신 바에 따라서, 임장과 주소는 연결은 해두지 않은 채, 만들어 두기만 했습니다.
확인하시고, Merge 부탁 드립니다.

@essaysir essaysir added the ✨ feature 기능 추가 label Mar 23, 2025
@OneToMany(mappedBy = "limjangId", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Record> recordList = new ArrayList<>();
@OneToOne(mappedBy = "limjangId", cascade = CascadeType.ALL, orphanRemoval = true)
private SharedNote sharedNote;
Copy link
Contributor

Choose a reason for hiding this comment

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

@OnetoOne 관계여도 @onetomany - @manytoone으로 관계설정하는 것은 어떨지 의견드려봅니다..!
@OnetoOne 관계는 관계주인이 아닌쪽을 조회할 때 지연로딩이 되지 않더라구요!!

참고 링크 : https://jeong-pro.tistory.com/249

Copy link
Contributor

Choose a reason for hiding this comment

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

현재 기존의 @OnetoOne 관계인 엔티티들도(Report 등등) 연관관계 주인이 아닌 쪽을 조회할 때 추가 쿼리가 나가고 있습니다!!

@PicturePark1101
Copy link
Contributor

제가 저번에 남겼던 요청은 기존 임장테이블의 해당 필드들을 제거하지말자는 제안이라 Address 엔티티와 Limjang 엔티티는 관계설정 해주셔도 될 것 같습니다..!
스크린샷 2025-03-23 오후 8 21 48

Copy link
Contributor

Choose a reason for hiding this comment

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

제 부분 엔티티 확인했습니다!! 서진님 코멘트만 확인해주시고 수정해주시면 좋을 것 같습니다. 주선님 너무 감사드려요~!

- 기존의 OneToOne을 ManyToOne 으로 변경
- Lazy Loading 이 빠져있는 부분 추가

@OneToOne(mappedBy = "limjangId", cascade = CascadeType.ALL, orphanRemoval = true)
private Report report;
@OneToMany(mappedBy = "limjangId", cascade = CascadeType.ALL, orphanRemoval = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

OneToOne -> OneToMany 매핑 변경해주신 것 확인했습니다! 고생 많으셨습니다. 감사합니다.

@hyeonahhh hyeonahhh merged commit 18aeb6a into dev Mar 25, 2025
1 check passed
@essaysir essaysir deleted the feat/#314 branch March 26, 2025 12:19
PicturePark1101 pushed a commit that referenced this pull request Jun 1, 2025
feat : ERD에 따른 엔티티 생성하기 #314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants