No row with the given identifier exists:
最近在弄一个后台项目,有用到hibernate操作数据库.写hql语句表一对一关联查询的时候报这个错误.受到了csdn上一篇博客的启发,解决了我的问题.他的博客地址:http://blog.csdn.net/eyejava/article/details/1896492
1.使用查询的hql语句
修正前:String hql="from MgjCardCommentEntity c left join c.userEntity user";
修正后:String hql="select c.id,user.id from MgjCardCommentEntity c left join c.userEntity user order by c.createTime desc";
这里只能查询出来这两张表的某些属性.我使用过right join查询,虽然不会报错但是结果集不理想.
这是我个人的总结,希望能帮到大家.有什么不正确的大家可以给我留言.
No row with the given identifier exists:的更多相关文章
- Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法
报错信息: org.hibernate.event.internal.DefaultLoadEventListener onLoad INFO: HHH000327: Error performing ...
- No row with the given identifier exists[ArtProject.Domains.Users#2]
产生此问题的原因: 有两张表,table1和table2. 产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-on ...
- (转)收集: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问题的解决办法及解决
(1)在学习Hibernate的时候遇到了这个问题"No row with the given identifier exists"在网上一搜看到非常多人也遇到过这个问题! 问题的 ...
- 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: [com.zhuoshi.entity.Dep#1]
报错信息: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.zhuoshi.e ...
- (转)No row with the given identifier exists问题的解决
产生此问题的原因: 有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-one unique ...
- Hibernate中常见问题 No row with the given identifier exists问题
收集:Hibernate中常见问题 No row with the given identifier exists问题的原因及解决 2007年11月21日 15:02:00 eyejava 阅读数:2 ...
- 关于Hibernate中No row with the given identifier exists问题的原因及解决
今天遇到一个bug,截图如下 有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-one unique=&q ...
随机推荐
- Unity内存优化(贴图层面)
聊聊近况: 距离上一篇文章已经过了好久,主要原因是我懒了.公司项目也到了开始优化的阶段,上网找的资料,看过了就忘.还是想把它整理一下,写出来.其实我说的东西,网上都有,我只是搬运工而已. 贴图压缩: ...
- eclipse下创建maven项目
1.创建一个Java项目 1)File--->New--->Other--->Maven--->Maven Projet 2)选择maven-archetype-quickst ...
- C#程序员开发WinForm必须知道的 Window 消息大全
不要以为下面的东西只有C++中才会用到哦! 消息,就是指Windows发出的一个通知,告诉应用程序某个事情发生了.例如,单击鼠标.改变窗口尺寸.按下键盘上的一个键都会使Windows发送一个消息给应用 ...
- IE6中内容高度比高级浏览器高的解决办法
1.div高度小于12px时,加over-flow:hidden; 2.多用padding,少用margin: 3.img vertical-align:top;
- ZOJ1913 Euclid's Game (第一道简单的博弈题)
题目描述: Euclid's Game Time Limit: 2 Seconds Memory Limit: 65536 KB Two players, Stan and Ollie, p ...
- *HDU 1757 矩阵乘法
A Simple Math Problem Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Ot ...
- JS的面向对象编程一:封装
Javascript是一种基于对象的语言,但它又没有class.这在很长的一段时间里,对JS的面向对象编程的概念很模糊,在编程的时候时有用到,但要说个所以然,却说不出来,所以看了些书,又在网上查了些资 ...
- bzoj2599: [IOI2011]Race(点分治)
写了四五道点分治的题目了,算是比较理解点分治是什么东西了吧= = 点分治主要用来解决点对之间的问题的,比如距离为不大于K的点有多少对. 这道题要求距离等于K的点对中连接两点的最小边数. 那么其实道理是 ...
- HTML Help WorkShop 创作、调用方法和技巧
一.在CHM 文件中所用到的弹出式菜单: 二.在HTML Help WorkShop 中不用显示的样式 (1).从右到右阅读顺序. (2).对话框 (3).滚动条在左边 (4).仅展开单个标题 ...
- TCP和UDP的区别
(1)TCP是面向连接的传输控制协议,而UDP提供了无连接的数据报服务:(2)TCP具有高可靠性,确保传输数据的正确性,不出现丢失或乱序:UDP在传输数据前不建立连接,不对数据报进行检查与修改,无须等 ...