반응형
MultipleBagFetchException
-
Spring - JPA cannot simultaneously fetch multiple bagsSpring 2022. 11. 4. 19:16
Caused by: org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags 하나의 entity에 한개 이상의 FetchType.EAGER 를 사용할 때 발생합니다. @Entity public class Person { @OneToMany(fetch = FetchType.EAGER, mappedBy = "person", cascade = CascadeType.REMOVE) private List phoneList; @OneToMany(fetch = FetchType.EAGER, mappedBy = "person", cascade = CascadeType.REMOVE) private List carLis..