No row with the given identifier exists 解决方法
来源:互联网 发布:网络维修是什么 编辑:程序博客网 时间:2024/05/21 07:02
有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-one unique="true">(特殊的多对一映射,实际就是一对一)来关联table2.当hibernate查找的时候,table2里的数据没有与table1相匹配的,这样就会报No row with the given identifier exists这个错.(一句话,就是数据的问题!)
假如说,table1里有自身的主键id1,还有table2的主键id2,这两个字段.
如果hibenrate设置的单项关联,即使table1中的id2为null值,table2中id2中有值,查询都不会出错.但是如果table1中的id2字段有值,但是这个值在table2中主键值里并没有,就会报上面的错!
如果hibernate是双向关联,那么table1中的id2为null值,但是table2中如果有值,就会报这个错.这种情况目前的解决办法就是改成单项关联,或者把不对应的数据改对!
假如说,table1里有自身的主键id1,还有table2的主键id2,这两个字段.
如果hibenrate设置的单项关联,即使table1中的id2为null值,table2中id2中有值,查询都不会出错.但是如果table1中的id2字段有值,但是这个值在table2中主键值里并没有,就会报上面的错!
如果hibernate是双向关联,那么table1中的id2为null值,但是table2中如果有值,就会报这个错.这种情况目前的解决办法就是改成单项关联,或者把不对应的数据改对!
- No row with the given identifier exists 解决方法
- No row with the given identifier exists 解决方法
- Hibernate异常No row with the given identifier exists 解决方法
- Hibernate异常No row with the given identifier exists 解决方法
- Hibernate异常No row with the given identifier exists 解决方法
- No row with the given identifier exists 解决方法(集锦)
- Hibernate异常No row with the given identifier exists 解决方法
- hibernate异常No row with the given identifier exists 解决方法
- No row with the given identifier exists 解决方法
- Hibernate异常No row with the given identifier exists 解决方法
- Hibernate异常No row with the given identifier exists 解决方法
- Hibernate异常No row with the given identifier exists 解决方法
- No row with the given identifier exists 解决方法
- No row with the given identifier exists 解决方法
- Hibernate异常No row with the given identifier exists 解决方法
- No row with the given identifier exists
- No row with the given identifier exists
- No row with the given identifier exists
- linux下OCCI编程(1)安装、运行
- WebRequest 乱码 问题
- JBOSS、ANT远程部署的异常解决!
- 自己的网页图标
- DataList中DropDownList如何触发它的SelectedIndexChanged事件
- No row with the given identifier exists 解决方法
- 在SQL中递归查询数据
- HUD 1000
- 使用boostpython小结
- filter过滤器的使用
- 读《大话设计模式》---模板方法模式(TemplateMethond)
- 寸劲的训练与应用
- 我们团队拥有自己的服务器了~~
- 日期自动补零程序