这是由于hiberante的懒加载机制出现的问题
以下在SpringBoot项目中的两种解决方案
第一种是在实体类上加上注解
@Proxy(lazy = false)
第二种是在配置文件application.properties中加入
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
这是由于hiberante的懒加载机制出现的问题
以下在SpringBoot项目中的两种解决方案
第一种是在实体类上加上注解
@Proxy(lazy = false)
第二种是在配置文件application.properties中加入
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true