Unable to evaluate the expression Method threw 'org.hibernate.LazyInitializationException' exception

Unable to evaluate the expression Method threw 'org.hibernate.LazyInitializationException' exception.

    • 错误
    • 解决方案

错误

实体类当前字段关系为 OneToMany。

    @OneToMany(mappedBy = "userId")
    private Set signInIds = new HashSet<>();

在这里插入图片描述

解决方案

加入 fetch = FetchType.EAGER ,然后在运行不会报错了。

    @OneToMany(mappedBy = "userId",fetch = FetchType.EAGER)
    private Set signInIds = new HashSet<>();

最后分享科学上网工具下载链接

https://share.antss013.com/aff/pNu2
//app可访问谷歌

你可能感兴趣的:(bug,java,jhipster,spring,boot,懒加载)