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:
package roseindia.tutorial.hibernate;
|
Output:
| 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: [51400]
|
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Hibernate Projection Example (Sum) View All Comments
Post your Comment