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.

你可能感兴趣的:(html,Hibernate)