In this section, you will learn to hibernate aggregate function like: sum() using hibernate projection.
The following example to calculate the sum of invested_amount to the Insurance table
Table Name: Insurance
Here is the code of program:
|log4j:WARN No appenders
could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: select sum(this_.invested_amount) as y0_ from insurance this_
Total Invested Amount: 
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: March 10, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles