Hibernate's Lazy strategy(1)
来源:互联网 发布:网络兼职正规 编辑:程序博客网 时间:2024/05/18 16:38
Lazy strategy is the default strategy for fetching entities and collections in Hibernate, and it is tightly related to Proxy.
For Example: User user = (User) session.load(User.class, id);
Then, the got user is actually not a USER, but a proxy acting like a user. Proxy is just a placeholder. When some properties(exception id) called for user, the proxy is initialized to a actual user(Here a execution of the SQL triggered).
However, If a get() method is used instead, then a DB hit always occurs. Then no proxy is used.
But, it is wrong to say Lazy strategy is not used for get.
If user has a collection(ex, friends), then the collection will also be lazy loaded.
TBD.
For Example: User user = (User) session.load(User.class, id);
Then, the got user is actually not a USER, but a proxy acting like a user. Proxy is just a placeholder. When some properties(exception id) called for user, the proxy is initialized to a actual user(Here a execution of the SQL triggered).
However, If a get() method is used instead, then a DB hit always occurs. Then no proxy is used.
But, it is wrong to say Lazy strategy is not used for get.
If user has a collection(ex, friends), then the collection will also be lazy loaded.
TBD.
- Hibernate's Lazy strategy(1)
- Hibernate's Lazy strategy(2)
- Hibernate Lazy
- hibernate---->lazy
- Hibernate lazy
- 浅谈hibernate lazy fetch
- Hibernate的lazy问题
- Hibernate中的lazy策略
- hibernate lazy策略
- hibernate lazy策略
- hibernate 中lazy作用
- hibernate lazy装载数据
- Hibernate的lazy问题
- Hibernate映射文件 lazy?
- Hibernate lazy属性
- hibernate的lazy使用
- hibernate--lazy机制
- Hibernate之lazy
- java读取文件源代码
- 精通cobol--9.1.3 表的基本用途
- .Net如何统计在线人数
- 江西IDC==提供服务器租用和托管
- SQL Server 2000 挂起问题 等 安装问题
- Hibernate's Lazy strategy(1)
- 精通cobol--9.1.4 几类典型结构的表
- Java中的main方法
- 宝剑锋从磨砺出,梅花香自苦寒来
- C# 编码规范和编程好习惯
- asp.net页面间传值的9种方式
- 最欠扁的脑筋急转弯
- [转]21世纪7种人才最抢手
- #define的用法归类