Prior to JPA 2.1, JPQL does not support the direct use of database functions (other than those invoked as a result of using the used JPQL function).
In accordance with the specification functions, JPA 2.1 is invoked as follows:
function_invocation :: = FUNCTION (function_name {, function_arg} *)
function_arg :: =
literal | state_valued_path_expression |
input_parameter |
scalar_expression
In the case of the RIGHT function, it looks like this:
FUNCTION("RIGHT, "some_string_possibly_path", 3)
With Hibernate, one of the possibilities is to expand the dialect as described in this .
source share