I have to calculate the average in Hibernate. How to calculate the average in Hibernate?
January 22, 2014 at 12:34 PM
You can use the project in Hibernate. Here is the example code of calculating the average on the fee field in database:
Check the tutorial for complete code example at Hibernate criteria avg.
January 23, 2014 at 6:27 PM
In HQL query you can use the database avg() function to calculate average
select avg(pojo property name) from <Pojo class name >