org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.zhuoshi.entity.Dep#1]
报错信息:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.zhuoshi.entity.Dep#1]
报错分析:
Hibernate的映射文件,表A里关联了表B的主键,当查询表A时,在B表里找不到对应记录时就会报错,如果只是逻辑删除不会报这种错误,
只有当表B里测试没有id为15的这条数据了才会报错(已实际测试过);上面报错信息实体类后面【#15】表示实体类对应表id=15的记录找不到。也就是存在垃圾数据,可能是因为没有连带删除。 解决办法:
1. 修改配置文件加上 not-found="ignore" ”
即:
<many-to-one name="adminusers" class="com.weixin.db.model.Adminusers"
fetch="select" lazy="false" not-found="ignore">
2.修改数据库中的垃圾信息
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.zhuoshi.entity.Dep#1]的更多相关文章
- Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法
		
报错信息: org.hibernate.event.internal.DefaultLoadEventListener onLoad INFO: HHH000327: Error performing ...
 - org.hibernate.ObjectNotFoundException: No row with the given identifier exists解决办法
		
hibernate-取消关联外键引用数据丢失抛异常的设置@NotFound hibernate项目里面配了很多many-to-one的关联,后台在查询数据时已经作了健全性判断,但还是经常抛出对象找不到 ...
 - org.hibernate.ObjectNotFoundException: No row with the given identifier exists
		
维护老系统时出现的问题,出现的原因我简述一下: table1与table2是关联表,T1中有T2的主键 "T1_id",当T1中的 "T2_id" 不为null ...
 - org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [cn.facekee.cms.entity.CmsFansgroup#195]
		
刚开始报错还是报的稀奇古怪的错误,让我纠结了好久,再三检查报错的位置,发现并没有错误,最后认真分析查看每行报错的信息才找到如题所述的错误!!!!! 报这种错误的原因可能是POJO映射文件中的字段和数据 ...
 - Hibernate常见问题 No row with the given identifier exists问题的解决办法及解决
		
(1)在学习Hibernate的时候遇到了这个问题"No row with the given identifier exists"在网上一搜看到非常多人也遇到过这个问题! 问题的 ...
 - 关于Hibernate中No row with the given identifier exists问题的原因及解决
		
今天遇到一个bug,截图如下 有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-one unique=&q ...
 - 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问题的原因及解决 产生此问题的原因: 有两张表,table1和table2.产生此问题的原因就是tab ...
 - Hibernate中常见问题 No row with the given identifier exists问题
		
收集:Hibernate中常见问题 No row with the given identifier exists问题的原因及解决 2007年11月21日 15:02:00 eyejava 阅读数:2 ...
 
随机推荐
- yii2部署nginx
			
页面全部提示404,nginx平台下需要额外配置yii rewrite规则,配置如下: 在nginx 的配置文件nginx.conf //增加部分 location / { # Redirect ev ...
 - LNMP的搭建
			
一.下载安装MySQL 1.1:下载地址:https://dev.mysql.com/downloads/mysql/ 1.2:安装后 1.2.1:解压:tar -xf mysql-8.0.15-li ...
 - CF  #552(div3)F   背包问题
			
题目链接:http://codeforces.com/contest/1154/problem/F 题意:一个商店有n个物品,每个物品只能买一次,同时有m种优惠,即一次买够x件后,这x件中最便宜的k件 ...
 - 远程桌面控制winsever,复制文件或者文件夹夹时出错提示“未指定的错误” 二(如何让远程电脑识别U盘)
			
一.背景: 要给远程服务器安装数据库,把安装复制到服务器,出现复制文件或者文件夹夹时出错提示“未指定的错误”:通过映射网络分享文件方法来解决,发现服务器访问网络出现错误,ping分享文件电脑的IP ...
 - 图融合之加载子图:Tensorflow.contrib.slim与tf.train.Saver之坑
			
import tensorflow as tf import tensorflow.contrib.slim as slim import rawpy import numpy as np impor ...
 - Objective-C基础教程 笔记
			
一.对C的扩展 1. #import VS #include C语言使用#include语句通知编译器应在头文件中查询定义. OC中也可以使用#include,但几乎不这么用,而是使用#import. ...
 - Debian9服务器安装mysql
			
第一步 添加mysql软件源 下载mysql的配置文件: cd /tmp wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all ...
 - 【jQuery、Express.js】AJAX提交Form
			
HTML/CSS代码 构建onclick事件 <div class = "row"> <div class = "col-md-10"> ...
 - JVM工具jstat使用说明
			
输入:jstat -help得到以下帮助信息 Usage: jstat --help|-options jstat -<option> [-t] [-h<lines>] < ...
 - python正则表达式补充
			
import re origin= "hello alex bcd alex 1ge alex acd 19" r=re.match("(?P<n1>h)(? ...