I am trying to run query below ,Postgres
database.
select new map(avg(cast (speed as double precision)) as avg)
from table
speed
column is of type varchar
I am executing using JPA as below
em = entityManagerFactory.createEntityManager();
Query hqlQuery = em.createQuery(query);
reportList = hqlQuery.getResultList();
When I run this I get error below
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE,
found 'precision' near line 1
Has anyone come across this situation? Can I not use precision in Hibernate?