Hql 中关于 count(*) 和 inner join fetch 联合使用的问题!急。。。

hql 如下:
String hql="from FcInstrateAdjust a inner join fetch a.fcAcc inner join fetch a.fcAcc.btNet inner join fetch a.fcInterestType where 1=1 ";

在构建Query对象的时候报错:
代码片段:

Query query = getSession().createQuery(
"select count(*) " + hql);
错误信息为:

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

想知道原因,及 解决方法,谢谢大家!

你是查询数据count,又不是查询对象的关联对象,用什么fetch ,
所以hibernate报错了

直接这样就行了
Query query = getSession().createQuery(
"select count(*) from FcInstrateAdjust " );