`
iamlotus
  • 浏览: 106622 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

hibernate中"fetch all properties" 不起作用

 
阅读更多

按照hibernate reference所说

 

 写道
If you are using property-level lazy fetching (with bytecode instrumentation), it is possible to force
Hibernate to fetch the lazy properties in the first query immediately using fetch all properties.
from Document fetch all properties order by name
from Document doc fetch all properties where lower(doc.name) like '%cats%'

 只要加了fetch all properties,在这个list被执行出来后,即使我close session,应该还是可以访问Document中的(lazy-loading)属性的,但我自己的做的实验显示这个"fetch all properties"加和不加完全没有区别,该是lazy loading的还是一个都没加载。

 

在hibernate的jira找到了这样的bug,但其fixed version是3.1 beta 1,而我的hibernate 是 hibernate-core-3.3.0.SP1.jar,这是咋回事,莫非reopen了?

 

忍不住再吐槽一下,用toplink时只有oralce 一家support,但基本都能找到答案,用hibernate一会儿要上官网,一会儿上stackoverflow,还经常找不到答案,开源啊开源~~

0
5
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics