改变懒加载只需要把生成的文件中的获取类型改为eager
fetch = FetchType.EAGER
@ManyToOne(fetch = FetchType.EAGER)//把懒加载换成饿加载模式 避免出现noSession@JoinColumn(name = "plan_id")public PlanTable getPlanTable() {return this.planTable;}
hibernate的反向生成改懒加载的地方
原文地址:https://www.cnblogs.com/charlypage/p/8962439.html