hibernate中的懒加载问题
来源:互联网 发布:视频软件公司简介 编辑:程序博客网 时间:2024/05/03 22:25
================================================================================
懒加载
================================================================================
通过asm和cglib二个包实现;domain是非final的。lazy指什么时候查询而fetch指通过那种方式查询。
1.session.load懒加载
2.one-to-one懒加载
必须同时满足下面三个条件时才能实现懒加载
1).主表不能有constrained=true,所以主表没有懒加载
2).constrained=true
3).fetch = select
3.one-to-many 懒加载
1).lazy != false;
2).fetch=select;
4.many-to-one :
1).lazy != false;
2).fetch=select;
5.many-to-many :
1).lazy != false;
2).fetch=select;
6.能够懒加载的对象都是被改写过的代理对象,当相关联的session没有关闭时,访问这些懒加载对象(代理对象)
的属性(getId和getClass除外)hibernate会初始化这些代理,或使用hibernate.initialize(proxy)来初始化代理
对象,当相关联的session关闭后,再访问懒加载的对象将出现异常。
- hibernate中的懒加载问题
- Hibernate中的懒加载问题
- java-web hibernate中的懒加载问题
- Hibernate中的懒加载
- hibernate懒加载问题
- hibernate懒加载问题
- hibernate懒加载问题
- hibernate懒加载问题
- hibernate懒加载问题
- hibernate 懒加载问题
- 彻底解决SSH架构中的Hibernate懒加载问题
- 彻底解决SSH架构中的Hibernate懒加载问题
- Hibernate中的延迟加载问题归纳
- Hibernate中的延迟加载(懒加载)
- hibernate的懒加载问题
- Hibernate的懒加载问题
- Hibernate中的lazy(懒加载)属性
- Hibernate中的懒加载原理分析
- Latex 算法的排版问题
- 资源文件及native2ascii的使用
- c++ 函数strncpy的使用陷阱
- Functional Programming
- SVN Error:请求的名称有效并且在数据库中找到,但是它没有相关的正确的数据来被解析
- hibernate中的懒加载问题
- Access restriction: The constructor SunJCE() is not accessible due to restriction on required library
- DotNet(C# )系统安装程序制作StepByStep(包括FrameWork安装和数据库安装...
- 见微知著
- ABAP 循环嵌套的优化
- Access restriction: The constructor SunJCE() is not accessible due to restriction on required librar
- php常用的类库
- 数据同步算法研究
- ABAP-判断内表是否为空