title: How to calculate average on a column with JPA?
body: <p>I would like to calculate average on a column.
  I tried the following:</p>
  
  <pre><code>@Query("SELECT AVG(e.rating) FROM user_rating e WHERE e.route_uid = ?1")
  fun averageOfRateings(routeId: UUID): Long
  </code></pre>
  
  <p>The query works in Sql, however I get the following error when I run the code in Spring Boot.</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException:
  user_rating is not mapped [SELECT AVG(e.rating) FROM user_rating e WHERE e.route_uid = ?1] 
  </code></pre>
  
  <p>What would be the right syntax? What is the problem with the mapping of my table?</p>