illegal attempt to dereference collection(转载的)
来源:互联网 发布:php 读取cer证书公钥 编辑:程序博客网 时间:2024/05/22 17:36
记录一下问题,这个是第二次出现了。还是没记下来为什么出现这个问题。那么,只能记录到博客中了,写一下,增加记忆力喽。
如题所示,出现这个问题, 取消引用非法的尝试,什么鬼。上网搜吧i,第一篇就是说这个问题的。很明了。
造成上述的原因是,sql语句写的不符合当前版本。
错误示范如下:FROM CheckupItem AS ci WHERE ci.modelInfos.id = ?,这样写本来没什么错误,但是,在使用的版本中,使用Set集合来关联的,并不是一个实体对象。在hibernate3.2.2版本之前不需要修改,这个hibernate会自动使用inner join 策略。后边的版本不支持。所以,需要自己去写。如下所示:
FROM CheckupItem AS ci INNER JOIN FETCH ci.modelInfos m WHERE m.id = ?
from 实体1 AS en1 INNDER JOIN FETCH 实体1.Set集合 别名2 WHERE 别名2.属性= ?
阅读全文
0 0
- illegal attempt to dereference collection(转载的)
- illegal attempt to dereference collection
- illegal attempt to dereference collection
- illegal attempt to dereference collection
- org.hibernate.QueryException: illegal attempt to dereference collection
- org.hibernate.QueryException: illegal attempt to dereference collection 异常
- 解决org.hibernate.QueryException illegal attempt to dereference collection 异常错误
- 解决org.hibernate.QueryException illegal attempt to dereference collection 错误异常
- Exception in thread "main" org.hibernate.QueryException: illegal attempt to dereference collection
- OpenSessionInViewFilter的两个异常:Illegal attempt to associate a collection with two open sessions
- Illegal attempt to associate a collection with two open session
- org.hibernate.HibernateException: Illegal attempt to associate a collection
- Illegal attempt to associate a collection with two open sessions
- Illegal attempt to associate a collection with two open sessions;
- Illegal attempt to associate a collection with two open sessions
- Illegal attempt to associate a collection with two open sessions.
- org.hibernate.HibernateException: Illegal attempt to associate a collection
- attempt to dereference a generic a pointer
- left jion中的on和where条件中的区别
- Android中进程间通讯常见的几种方式以及使用场景
- 《Objective-C基础教程》第9章 内存管理
- 简简单单搞掂恼人的Laravel 5安装
- 【Java练习】利用xml做一个简易的通讯录
- illegal attempt to dereference collection(转载的)
- 004_跨平台开发_MUI_操作表(actionsheet)
- 学生成绩转换
- 一个合格数字IC设计工程师的知识结构
- JAVA知识_7
- 排序算法之归并排序
- MySQL
- IT维护对企业竞争力的影响
- 2017秋招-技术岗-恒生电子