The attached tests contain a case that is similar to
that shows a JPQL query as follows:
like SELECT a FROM Author a WHERE :lastName IS NULL OR LOWER(a.lastName) =
Hibernate crashes in cases where the parameter values are null:
ERROR: operator does not exist: character varying = bytea
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
The message originating from the engine or driver are not helpful because JPQL does not support type casts.
I think the times are over where on application level one had to code different queries depending on whether a parameter value was null or not.
HIbernate 4.1.1 final, Postgresql driver 9.1-901-1.jdbc4