当你需要从实体两端获取数据时,可以用立即抓取(eager fetching)覆盖默认策略,例壤旃用HQL或Criteria配置连接抓取(join fetching)。
基于16个网页-相关网页
msgstr "谨慎的使用主动抓取(eager fetching)。对于关联来说,若其目标是无法在第二级缓存中完全缓存所有实例的类,应该使用代理(proxies)与/或具有延迟加载属性的集合(la...
基于12个网页-相关网页
Eager and Lazy Fetching 立即取和延迟取
Hibernate has no solution for the above issue. This in turn indicates that we should never use eager fetching in our query for second-level cached objects.
这就说明Hibernate也没有解决这个问题,从而表明我们不应该在查询中通过预先抓取来获得二级缓存中的对象。
On the other hand using Eager-fetching has the following disadvantages.
但另一方面,使用预先抓取也存在如下弊端
应用推荐