I'm having difficulty with the HQL "select new" constructor and the aggregation functions available with reporting queries. Specifically, I'm wondering what datatypes Hibernate returns for COUNT, AVG, etc.
On HIA pg. 275 the text reads:
If we define a class called ItemBidSummary with a constructor that takes a Long, a String, and an Integer, we can use the following query:
select new ItemBidSummary( bid.item.id, count(bid), avg(bid.amount) )...
The datatypes listed in the text are inconsistent with what I would expect out of those aggregations.
Also, I've searched the CaveatEmptor sample code for the ItemBidSummary class to see what the constructor was actually doing, and can't find any such definition. Am I looking in the wrong place? Thanks,
-Scott
|