(已解决)org.hibernate.ObjectNotFoundException: No row with the given identifier exists
2017-12-20 16:14
661 查看
原因:有两张表,t1和t2.产生此问题的原因就是t1里做了关联<one-to-one>或者<many-to-one unique="true">(特殊的多对一映射,实际就是一对一)来关联t2.当hibernate查找的时候,t2里的数据没有与t1相匹配的,这样就会报No row with the given identifier exists这个错.
解决方法:以我程序为例,在many-to-one标签里加入not-found="ignore"即可,下面是修改后的代码:
<many-to-one name="name" class="common.models.Model" not-found="ignore"
lazy="false">
<column name="s_name" length="250" sql-type="varchar2" />
</many-to-one>
解决方法:以我程序为例,在many-to-one标签里加入not-found="ignore"即可,下面是修改后的代码:
<many-to-one name="name" class="common.models.Model" not-found="ignore"
lazy="false">
<column name="s_name" length="250" sql-type="varchar2" />
</many-to-one>
相关文章推荐
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.zero.space.entity.TblJd#38]解决方法
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists解决办法
- 关于org.hibernate.ObjectNotFoundException: No row with the given identifier exists 的快捷解决问题
- Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法
- 【hibernate】关于org.hibernate.ObjectNotFoundException: No row with the given identifier exists 的快捷解决问题
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists .
- Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xxx.xx.model.info.News#15]
- Caused by: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: 原因
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [xx]
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists
- 【hibernate】org.hibernate.ObjectNotFoundException: 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
- org.hibernate.ObjectNotFoundException: 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: [cn.facekee.cms.entity.CmsFansgroup#195]
- org.hibernate.ObjectNotFoundException: 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:
- org.hibernate.ObjectNotFoundException: No row with the given identifier exists