Inflearn Community Q&A
@oneToOne fetch = Lazy를 입력했는데 적용이 되지 않습니다.
Written on
·
1.9K
1
@OneToOne(mappedBy = "delivery", fetch = LAZY)
private Order order;이렇게 작성을 하면 fetch = Lazy 부분이 색깔이 변하면서 노란 전구 경고를 주는데
Specifying FetchType.LAZY for the non-owning side of the @OneToOne association will not affect the loading. The related entity will still be loaded as if the FetchType.EAGER is defined.
@OneToOne 연결의 비소유 측면에 대해 FetchType.LAZY를 지정해도 로딩에 영향을 미치지 않습니다. FetchType.EAGER가 정의된 것처럼 관련 엔터티가 계속 로드됩니다.
이렇게 경고를 주게 되네요 다른부분은 다 잘 되는데 이부분만 이러는것이 구글링을 해도 잘 모르겠네요...

JPA웹앱javaspring-bootspring
Quiz
41% of people got it wrong. Give it a try!
In a One-to-Many relationship, where should the Foreign Key generally be located?
Located on the 'One' side.
It is located on the 'Da' (Many) side.
It is located on the non-owner side of the relationship (Owner).
It depends on relationship settings, so there is no fixed rule.
Answer 3
1
1
0









계속해서 찾다보니 좋은 블로그를 찾아서 해결했습니다.
https://jeong-pro.tistory.com/249
감사합니다.