0
這是SQL查詢如何在Hibernate中通過查詢來編寫該組?
SELECT type ,SUM(amount) FROM CustomerPayment GROUP BY type
我怎麼可以這樣寫休眠?
這是SQL查詢如何在Hibernate中通過查詢來編寫該組?
SELECT type ,SUM(amount) FROM CustomerPayment GROUP BY type
我怎麼可以這樣寫休眠?
它在HQL相同的:
select c.type, sum(c.amount) from CustomerPayment c group by c.type
上述代碼給出org.hibernate.QueryException:在預期:C [選擇c.type,總和爲c(c.amount)從CustomerPayment C組。類型] \t at org.hibernate.hql.classic.FromParser.token(FromParser.java:106)error – user2326472 2013-04-29 19:41:41
發佈'CustomerPayment'實體的代碼。我認爲你有數量和類型列映射到相關領域。 – dcernahoschi 2013-04-29 19:43:30
是啊,我有他們在我的表 – user2326472 2013-04-29 19:43:55