save the transient instance before flushing
来源:互联网 发布:飞天面条 知乎 编辑:程序博客网 时间:2024/06/06 03:39
三张数据表的关系如下图
在java中如下写法报错(错误信息:save the transient instance before flushing):
@OneToMany(fetch=FetchType.LAZY) //这种情形会报错save the transient instance before flushing: elitel.szy.groundwater.entity.PlanLayer
@JoinColumn(name="PLID")
public List<PlanLayer> getLayers() {
return layers;
}
public void setLayers(List<PlanLayer> layers) {
this.layers = layers;
}
将上述代码修改下,错误解决:
@OneToMany(fetch = FetchType.LAZY , cascade=CascadeType.ALL)
@JoinColumn(name="PLID")
public List<PlanLayer> getLayers() {
return layers;
}
public void setLayers(List<PlanLayer> layers) {
this.layers = layers;
}
但为什么如此改就可以解决问题,还不清楚。
0 0
- save the transient instance before flushing
- save the transient instance before flushing
- save the transient instance before flushing
- save the transient instance before flushing错误解决办法
- Hibernate常见错误之save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing异常
- object references an unsaved transient instance - save the transient instance before flushing(异常总结)
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing .
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing(异常总结)
- object references an unsaved transient instance - save the transient instance before flushing
- object references an unsaved transient instance - save the transient instance before flushing
- PhoneGap开发环境搭建
- 查看oracle数据库的sid
- (zz)actors角色模型系列之一 actors介绍以及akka 框架的使用入门
- MATLAB 调用编译.c/.cpp文件
- CodeForces 519E A and B and Lecture Rooms
- save the transient instance before flushing
- git 使用小结
- [省选前题目整理][BZOJ 1009][HNOI 2008]GT考试(KMP+DP+矩阵快速幂)
- WebSocket 原理介绍及服务器搭建
- [LeetCode]Insert Interval
- SIGHUP信号与控制终端
- 连载《一个程序员的成长历程》-15.老婆怀孕,养家压力,离职请求
- Sizeof与Strlen的区别与联系
- c++11 move