반응형
스프링 jpa
-
Spring - LazyInitializationException: could not initialize proxy – no SessionSpring 2022. 9. 20. 01:32
JPA를 쓰다보면 이런 에러메시지를 볼 때가 있습니다. 에러메시지 Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.example.domain.CompanyEntity.personList, could not initialize proxy - no Session Entity 코드 @Entity @Table(name = "company") public class Company implements Serializable { @Id @Column(name = "id") private Long id; @OneToMany(fetch = FetchType.LAZY, mappe..