Is it possible to use casts in JPQL? In HQL it seems to be supported
cast(... as ...), where the second argument is the name of a Hibernate type, and extract(... from ...) if ANSI cast() and extract() is supported by the underlying database
source : Hibernate reference
My target JPA provider is EclipseLink, so any EclipseLink specific solution is ok as well.