You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
무한 조회
DepotConverter
DepotMapper
DepotSimpleMapper
📌 JPA 무한 조인/무한 로딩 문제가 발생하는 원리 (요약)
DepotConverter
핵심 로직
💡 계층별로 Mapper가 분리되어 있어, 한 엔티티에서 너무 많은 연관 엔티티를 한 번에 deep copy 하지 않도록 제어함, 즉, 연관관계 확산을 분리해서 통제, 무한 JOIN, 중첩 복사를 방어
DepotMapper
DepotSimpleMapper
DepotSimpleMapper는 “Depot 단일 객체”만 남기고, 모든 연관 테이블을 끊어버리는 Mapper
이 Mapper가 사용되는 순간:
✔ Depot 내부에서
✔ Jobs, Vehicles, Clusters 엔티티 탐색이 완전히 차단됨
➡ 즉, JPA의 깊은 fetch cascade 확장이 멈춤
➡ DTO 변환 중 엔티티 순환 접근도 불가능해짐
➡ 결과적으로 무한 JOIN, N배 로딩, Deep Graph 탐색이 모두 사라짐
All reactions