failed to lazily initialize a collection of role
来源:互联网 发布:汉倭奴国王金印 知乎 编辑:程序博客网 时间:2024/05/16 11:58
failed to lazily initialize a collection of role
分类: 技术2007-02-12 20:11
在某个表自己进行一对多的关系的时候,在hibernate配置文件中,如果这样常规配置:
<set name="childrens" inverse="true">
<key>
<column name="parentid" />
</key>
<one-to-many class="Question" />
</set>
看起来好像没什么,但运行起来,当你getChildrens后,就会出现failed to lazily initialize a collection of role这个错误。
原因可能是当你加载类似于树型结构的类时,需要一次全部加载,而不能让children在parent已经加载后再加载,解决方法是
<set name="childrens" inverse="true" lazy="false">
<key>
<column name="parentid" />
</key>
<one-to-many class="Question" />
</set>
- failed to lazily initialize a collection of role:
- failed to lazily initialize a collection of role:
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role问题
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role:报错
- failed to lazily initialize a collection of role
- JsonMappingException: failed to lazily initialize a collection of role
- failed to lazily initialize a collection of role
- oracle中的dual表详解
- 如何对程序员进行绩效考核
- tomcat 绿色免安装版
- 开始研究LTE-Advanced
- PHP输出当前进程所有变量 / 常量 / 模块 / 函数 / 类
- failed to lazily initialize a collection of role
- 如何在Drupal当中对内容进行评价和打分?
- Oracle 10g 在linux下的安装
- C++的特殊工具与技术
- 115、sybase ec开发问题易犯问题
- Flash游戏存档文件 .sol文件替换+拷贝教程 附sol Editor下载
- 归并排序的简单算法
- 伯南克言辞模棱两可,美元先扬后抑
- 美制造迄今最大激光脉冲:500万亿瓦特功率