在使用Hibernate的持久化实体的上下文中,当开发人员获得LazyInitializationException,... no session or session was closed时,我想给他们提供更多的线索我考虑过在加载缓慢的字段getter中捕获它,然后抛出一个带有新消息的IllegalStateException:
@OneToMany(mappedBy = "whatever", fetch = FetchType.LAZYgetU
我创建了两个具有@Entities映射的@ManyToMany:Team和Game。
目前,数据库中有一个保存teams的表,我想插入一个引用两个teams的game。creating bean with name 'dataLoader': Invocation of init method failed; nested exception is org.hibernate.LazyInitializationExceptionRestartLauncher.java:49) [spring-boot-devtools-1.3.0.RE