HQL分组查询总记录条数

我在mysql中写的:
select count(*) from (select count(*) from tb_order_list as a, tb_goods_goodsinfo as b ,tb_order c WHERE a.order_id=c.order_id and a.product_id=b.SYS_ID GROUP BY a.product_id ) temp
可以正常使用,但是在hql里面该怎么写啊?求大神指教

用hibernate执行sql不行吗?为什么非要用hql呢?