Spring boot 解决 hibernate no session异常

 

启动类中加入 

@Bean
public OpenEntityManagerInViewFilter openEntityManagerInViewFilter(){
return new OpenEntityManagerInViewFilter();
}

配置文件中加入 spring.jpa.open-in-view=true

参考

解决Spring Data JPA延迟加载no session错误  http://blog.csdn.net/chrislyl/article/details/54630413

posted @ 2017-11-07 11:15  每天多帅一点点  阅读(2040)  评论(0编辑  收藏  举报