标签: java hibernate
这是sql
SELECT type ,SUM(amount) FROM CustomerPayment GROUP BY type
我如何在休眠中写这个?
答案 0 :(得分:2)
在hql中是一样的:
select c.type, sum(c.amount) from CustomerPayment c group by c.type