`
xiaotian_ls
  • 浏览: 308146 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

Hibernate query specified join fetching ...

阅读更多
写道
hql.append(" from DutyCallover t left join fetch t.duty where 1=1 ");

 

 

Hibernate报错:

query specified join fetching, but the owner of the fetched association was not present in the select list

 

参考:
http://www.hibernate.org/250.html?cmd=prntdoc

 

写道
Furthermore, a query that specifies join fetching, but the owner of the fetched association was not present in the select list throws an exception now: "select b from A join fetch a.bees b" - this query makes no sense, remove the "fetch".

 

去掉fetch就可以,但是返回的每个Page.resultList对象是二维数组,index为0是目标对象DutyCallover,index为1是它的关联对象DutyInfo.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics