I got an exception when I deploy the following query on tomcat :
@Query("select max(cast(substring(r.reference,9,4) as decimal(4,0))) from RequestDbo r where substring(r.reference,0,9) = :referenceRoot")
Long getMaxReference(@Param("referenceRoot") String referenceRoot);
The exeption is :
org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE, found '(' near line 1, column 54 [select max(cast(substring(r.reference,9,4) as decimal(4,0))) from RequestDbo r where substring(r.reference,0,9) = :referenceRoot]
Althoug the query is ok when executed directly on sql server.
I see no syntax error in my hql...
Any ideas ?