I had no problems with the following in Hibernate JPA
SELECT e
FROM Employee e
INNER JOIN FETCH e.address AS a
WHERE a.state = :state
AND e.middle = :middle
AND trunc(a.birthdate) > :mindate
However, eclipselink croaks syntax error on
trunc(a.birthdate) > :mindate
How do I encapsulate an alias-referenced field with an SQL function in eclipselink?
The problem isn’t the alias reference but the
trunc()function – trunc is SQL not JPQL.The answer to this question might help you:
SQL for NamedQuery in EclipseLink