Hibernate中No row with the given identifier exists
来源:互联网 发布:淘宝女童秋装 编辑:程序博客网 时间:2024/06/06 15:04
产生此问题的原因:
原因1: 有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-oneunique="true">(特殊的多对一映射,实际就是一对一)来关联table2.当hibernate查找的时候,table2里的数据没有与table1相匹配的,这样就会报No row with the givenidentifier exists这个错.
假如说,table1里有自身的主键id1,还有table2的主键id2,这两个字段.
如果hibenrate设置的单项关联,即使table1中的id2为null值,table2中id2中有值,查询都不会出错.但是如果table1中的id2字段有值,但是这个值在table2中主键值里并没有,就会报上面的错!
如果hibernate是双向关联,那么table1中的id2为null值,但是table2中如果有值,就会报这个错.这种情况目前的解决办法就是改成单项关联,或者把不对应的数据改对!
原因2:
hibernate在用注解写bean的时候,若字段上忘记加注解,同样可能会报这个错
原因1:
原因2:
hibernate在用注解写bean的时候,若字段上忘记加注解,同样可能会报这个错
阅读全文
0 0
- Hibernate中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错误
- Hibernate: No row with the given identifier exists
- org.hibernate.ObjectNotFoundException: 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 解决方法
- org.hibernate.ObjectNotFoundException: 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 解决方法
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists
- hibernate异常No row with the given identifier exists 解决方法
- hibernate bug --No row with the given identifier exists
- hibernate:错误 No row with the given identifier exists
- JMX 入门(一)
- Spring Web MVC(一)
- 深入JVM锁机制2-Lock
- Spring配置文件和SpringMVC配置文件 web.xml配置文件 保存自用
- Elastic Search权威指南 第一章 ES基础概念
- Hibernate中No row with the given identifier exists
- 栈和队列操作
- HDU 6150 Vertex Cover 构造
- DirectX11 使用Cube Mapping 立方体环境贴图实现天空、物体反射效果
- 图像的柱面投影纠正
- Activity XML属性
- ch1 数据结构绪论
- Elastic Search权威指南 第二章 分布式文档存储的过程
- CCF 高速公路