I have to calculate the average in Hibernate. How to calculate the average in Hibernate?
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.
In HQL query you can use the database avg() function to calculate average
select avg(pojo property name) from <Pojo class name >