Hibernate version:2.1.6
Hi,
Please help me to get the results of the following SQL query using HQL or native SQL support in hibernate.
Code:
select g.categoryid, g.categoryname, sum(b.amount) totalbill,
sum(case when c.gender='F' then b.amount else 0 end) totalfemalebill
from category g
left join customer c on g.categoryid = c.categoryid
left join bill b on b.customerid = .customerid
group by g.categoryid, g.categoryname
order by g.categoryname
The tables are as follows:
category (class Category)
----------
categoryid
categoryname
customer (class Customer)
----------
customerid
categoryid
gender
customername
bill (class Bill)
----------
billid
customerid
amount
billdate