No row with the given identifier exists 解决方法
来源:互联网 发布:mac office 完全卸载 编辑:程序博客网 时间:2024/06/05 05:45
No row with the given identifier exists 解决方法
有两张表,a和b.产生此问题的原因就是a里做了关联<one-to-one>或者<many-to-one unique="true">(特殊的多对一映射,实际就是一对一)来关联b.当hibernate查找的时候,b里的数据没有与a相匹配的,这样就会报No row with the given identifier exists这个错.(一句话,就是数据的问题!)
假如说,a里有自身的主键id1,还有b的主键id2,这两个字段.
如果hibenrate设置的单项关联,即使a中的id2为null值,b中id2中有值,查询都不会出错.但是如果a中的id2字段有值,但是这个值在b中主键值里并没有,就会报上面的错!
如果hibernate是双向关联,那么a中的id2为null值,但是b中如果有值,就会报这个错.这种情况目前的解决办法就是改成单项关联,或者把不对应的数据改对!
假如说,a里有自身的主键id1,还有b的主键id2,这两个字段.
如果hibenrate设置的单项关联,即使a中的id2为null值,b中id2中有值,查询都不会出错.但是如果a中的id2字段有值,但是这个值在b中主键值里并没有,就会报上面的错!
如果hibernate是双向关联,那么a中的id2为null值,但是b中如果有值,就会报这个错.这种情况目前的解决办法就是改成单项关联,或者把不对应的数据改对!
0 0
- 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
- iOS文字转语音播放
- 【第一弹】【HDU2191】【悼念512汶川大地震遇难同胞——珍惜现在,感恩生活】
- 在springmvc中通过过滤器获取request和response
- jquery.autocomplete.js的简单使用
- web.config文件详解
- No row with the given identifier exists 解决方法
- [JQuery学习笔记]——之一
- 在centos7 ubuntu15.04 上通过bosh-lite 搭建单机环境cloudfoundry
- 图片滚动代码
- 修改.htaccess的重写规则
- 数据库索引的作用和优点缺点
- Inno Setup 实现自定义文件类型的安装脚本
- 整合:图论存图方法及三种重要做法分析(Kruskal Dijkstra Bellman-Ford)
- Quartz异常的一些处理