hibernate异常Hibernate异常:query specified join fetching, but the owner of the fetched association was n
来源:互联网 发布:wow数据库7.2 编辑:程序博客网 时间:2024/05/22 07:07
项目中想级联查询表中的某些字段发生Hibernate异常:query specified join fetching, but the owner of the fetched association was not present in the select list异常,查了很多资料没有解决最后还是自己乱碰解决了。现记录如下:
new StringBuffer() .append("select new com.jhzy.model.News(n.id, n.title, n.source, n.flag, n.addTime, nt) from News n left join n.newsType nt left join n.user u where ") .append("(nt.name ") .append(" like '%") .append(paramValue) .append("%' or n.source like '%") .append(paramValue) .append("%' or ") .append(" n.title") .append(" like '%") .append(paramValue) .append("%') order by n.flag desc, nt.sequence asc, n.addTime desc")
用new 生成查询对象的时候就不用fetch关键字,但是得在model类中建立相应类型的构造方法。
- hibernate异常Hibernate异常:query specified join fetching, but the owner of the fetched association was n
- Hibernate异常:query specified join fetching, but the owner of the fetched association was not present
- Hibernate异常:query specified join fetching, but the owner of the fetched association was not present in the select list
- org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the sel
- org.hibernate.QueryException: query specified join fetching, but the owner of the fetched associatio
- query specified join fetching, but the owner of the fetched association was not present in the selec
- query specified join fetching, but the owner of the fetched association was not present in the selec
- query specified join fetching, but the owner of the fetched association was not present in the selec
- 【解决Hiberate】 query specified join fetching, but the owner of the fetched association..
- org.hibernate.WrongClassException: Object with id: 3 was not of the specified subclass
- Hibernate异常: a different object with the same identifier value was already associated with the sessi
- Hibernate异常Hibernate 异常:Association references unmapped class
- Hibernate异常:Association references unmapped class
- Hibernate 异常:Association references unmapped class
- hibernate异常:a different object with the same identifier value was already associated
- 【iOSiOS/Xcode异常:reason:loaded the “SimpleTableViewController” nib but the view outlet was not set
- 【iOS】iOS/Xcode异常:reason:loaded the “SimpleTableViewController” nib but the view outlet was not set
- 开发中遇到的hibernate异常:a different object with the same identifier value was already associated with the
- 林志颖VS方舟子 Linboss从容应对显智慧
- webrtc教程
- zebra的命令存储原理和使用方法
- first blog
- 图片Slider 带左右按钮
- hibernate异常Hibernate异常:query specified join fetching, but the owner of the fetched association was n
- UML模型图
- vs2010修改项目名称
- 聚类
- C++中Txt文件读取和写入
- 根据汉字获取它的字符串拼音首字母(大写),含多音字
- C++函数形参中的省略号
- 【闲话程序员生涯】哪些人有可能遇到职业瓶颈
- 永远不要在 Linux 执行的 10 个最危险的命令