I have a query that is summing a field with datatype float and constructing a new Bean based on the result. eg:
Code:
select new FreightSummaryBean(f, sum(fl.convertedAmount), sum(fl.carrierCurrencyAmount)) from FreightInvoice f left join f.freightInvoiceLines as fl
...etc etc
I had trouble specifying the correct constructor for the FreightSummaryBean.
The Hibernate in Action book implies that the datatype of the sum will be the datatype of the field being summed ("The query returns a BigDecimal because the amount property is of type BigDecimal. The sum() function also recognizes BigInteger property types and returns Long for all other numeric property types...").
As you can see from the subject, the SUM actually returns a Double.
This page from the NHibernate Migration guide has the only statement that floats return Double.
http://www.hibernate.org/407.html
Have I missed some documentation somewhere? I would have thought that this info would have been in the core docs.
Cheers,
Damian.