最近在弄一个后台项目,有用到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:的更多相关文章

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

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

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

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

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

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

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

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

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

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

  6. org.hibernate.ObjectNotFoundException: No row with the given identifier exists

    维护老系统时出现的问题,出现的原因我简述一下: table1与table2是关联表,T1中有T2的主键 "T1_id",当T1中的 "T2_id" 不为null ...

  7. 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 ...

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

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

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

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

  10. 关于Hibernate中No row with the given identifier exists问题的原因及解决

    今天遇到一个bug,截图如下 有两张表,table1和table2.产生此问题的原因就是table1里做了关联<one-to-one>或者<many-to-one unique=&q ...

随机推荐

  1. 关于Android中res目录strings.xml文件中的转义字符之笔录

    res目录strings.xml文件中的转义字符:         ------------------>     代表着一个汉字的位置:                        ---- ...

  2. Maven打包 报 Unable to locate the Javac Compiler in: C:\Program Files\Java\jre1.8.0_73\..\lib\tools.jar

    无法找到javac 编译环境 右键项目 --> properties -->Java Build Path -->选中JRE 点击右侧 Edit 编辑 --> 把你设置的JRE ...

  3. cocoapods安装出错问题

    今天执行pod install时,出现了错误,提示更新,好,那就更新; 1.终端执行了下:gem sources -l   查看了下源 *** CURRENT SOURCES *** https:// ...

  4. POJ1026 Cipher(置换的幂运算)

    链接:http://poj.org/problem?id=1026 Cipher Time Limit: 1000MS   Memory Limit: 10000K Total Submissions ...

  5. RadioGroup实现导航栏

    ​[声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/ ...

  6. C#使用HttpWebRequest 进行请求,提示 基础连接已经关闭: 发送时发生错误。

    本人今天遇到的错误,C#使用HttpWebRequest 进行请求,提示 基础连接已经关闭: 发送时发生错误. 测试了很久,才发现,是安全协议问题,把安全协议加上就可以了

  7. 读取XML直接转换为类对象

    <?xml version="1.0" encoding="utf-8"?> <ArrayOfMenuItems xmlns:xsi=&quo ...

  8. SQL Server无法收缩日志文件 2 因为逻辑日志文件的总数不能少于 2问题

    SQL Server无法收缩日志文件 2 因为逻辑日志文件的总数不能少于 2问题 最近服务器执行收缩日志文件大小的job老是报错 我所用的一个批量收缩日志脚本 USE [master] GO /*** ...

  9. 使用 Productivity Power Tools 2013来帮助你提高 VS2013的工作效率

    Visual Studio Gallery中发布了Productivity Power Tools 2013 的更新.在此版本中,此版本解决了客户报告的大量错误和问题,并介绍了一项称为语法行压缩的新功 ...

  10. 清晰易懂TCP通信原理解析(附demo、简易TCP通信库源码、解决沾包问题等)C#版

    目录 说明 TCP与UDP通信的特点 TCP中的沾包现象 自定义应用层协议 TCPLibrary通信库介绍 Demo演示 未完成功能 源码下载 说明 我前面博客中有多篇文章讲到了.NET中的网络编程, ...