写道
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.
本文探讨了Hibernate中使用左连接查询(join fetch)时遇到的具体错误及其解决方案。错误信息提示查询指定的左连接获取(join fetching),但被获取关联的所有者未出现在select列表中。文章提供了去除fetch选项后的效果说明。
5017

被折叠的 条评论
为什么被折叠?



