这个异常是在 多对一关系映射时,一方表中对应的数据不存在才抛出的。
原来的配置:

<many-to-one class="com.art.model.user.UserInfo" fetch="join" name="userInfo" >
<column name="userId" unique="true"/>
</many-to-one>

修改后的:

<many-to-one class="com.art.model.user.UserInfo" fetch="join" name="userInfo" not-found="ignore">
<column name="userId" unique="true"/>
</many-to-one>

红色是修改的部分。意思是当对应的数据不存在时 忽略掉,用null值填充。该属性默认值:exception 。

Hibernate3.x异常No row with the given identifier exists 解决方法的更多相关文章

  1. org.hibernate.ObjectNotFoundException: No row with the given identifier exists解决办法

    hibernate-取消关联外键引用数据丢失抛异常的设置@NotFound hibernate项目里面配了很多many-to-one的关联,后台在查询数据时已经作了健全性判断,但还是经常抛出对象找不到 ...

  2. Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法

    报错信息: org.hibernate.event.internal.DefaultLoadEventListener onLoad INFO: HHH000327: Error performing ...

  3. Hibernate错误——No row with the given identifier exists

    错误 是用的是Hibernate自动建立的数据表,在进行数据库操作时,出现错误No row with the given identifier exists 解决 关系数据库一致性遭到了破坏,找到相关 ...

  4. No row with the given identifier exists[ArtProject.Domains.Users#2]

      产生此问题的原因:              有两张表,table1和table2. 产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-on ...

  5. (转)收集:Hibernate中常见问题 No row with the given identifier exists问题的原因及解决

    Hibernate中No row with the given identifier exists问题的原因及解决 产生此问题的原因: 有两张表,table1和table2.产生此问题的原因就是tab ...

  6. Hibernate常见问题 No row with the given identifier exists问题的解决办法及解决

    (1)在学习Hibernate的时候遇到了这个问题"No row with the given identifier exists"在网上一搜看到非常多人也遇到过这个问题! 问题的 ...

  7. (转)No row with the given identifier exists问题的解决

    产生此问题的原因:         有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-one unique ...

  8. Hibernate中常见问题 No row with the given identifier exists问题

    收集:Hibernate中常见问题 No row with the given identifier exists问题的原因及解决 2007年11月21日 15:02:00 eyejava 阅读数:2 ...

  9. Tomcat异常 Multiple Contexts have a path of "/qqshl".解决方法

    Tomcat异常 Multiple Contexts have a path of "/qqshl".解决方法 找到tomcat映射文件Service.xml,将文件中的conte ...

随机推荐

  1. kNN(K-Nearest Neighbor)最邻近规则分类

    KNN最邻近规则,主要应用领域是对未知事物的识别,即推断未知事物属于哪一类,推断思想是,基于欧几里得定理,推断未知事物的特征和哪一类已知事物的的特征最接近: K近期邻(k-Nearest Neighb ...

  2. Install WordPress Plugins without FTP Access

    WordPress will only prompt you for your FTP connection information while trying to install plugins o ...

  3. ASP.NET MVC中的Session以及处理方式

    最近在ASP.NET MVC项目中碰到这样的情况:在一个controller中设置了Session,但在另一个controller的构造函数中无法获取该Session,会报"System.N ...

  4. java多台

    多 态★★★★★(面向对象特征之一):函数本身就具备多态性,某一种事物有不同的具体的体现. 体现:父类引用或者接口的引用指向了自己的子类对象.//Animal a = new Cat();父类可以调用 ...

  5. Java Web应用软件保护方法

    1 代码混淆概述目前针对Java源文件方法主要有以下几种方法:本地编译技术.数字水印技术.ClassLoader加密技术以及代码混淆技术.Java本地编译是指将Java应用程序编译成本地应用程序,如W ...

  6. Spring3数据库事务管理机制

    Spring对事务的解决办法其实分为2种:编程式实现事务,AOP配置声明式解决方案. http://jinnianshilongnian.iteye.com/blog/1496953 Spring提供 ...

  7. Oracle中索引的使用 索引性能优化调整

    索引是由Oracle维护的可选结构,为数据提供快速的访问.准确地判断在什么地方需要使用索引是困难的,使用索引有利于调节检索速度. 当建立一个索引时,必须指定用于跟踪的表名以及一个或多个表列.一旦建立了 ...

  8. iOS获取网络类型的四种方法

    Reachability类只能区分WIFI和WWAN类型,却无法区分2G网和3G网. 网上也有些方法,却都存在Bug. 经过网上查找资料和测试,基本上总结了以下几种方法: 1.使用导航栏的方式:(私有 ...

  9. 《Windows核心编程》第十一章——线程池

    隐式使用工作项 #include <iostream> #include <windows.h> ; VOID NTAPI SimpleCallback(PTP_CALLBAC ...

  10. 如何使用C++回调函数

         程序猿经常须要实现回调.本文将讨论函数指针的基本原则并说明怎样使用函数指针实现回调.注意这里针对的是普通的函数,不包含全然依赖于不同语法和语义规则的类成员函数(类成员指针将在另文中讨论). ...