Encounter the same problem in 5.3.7 which are described at :
* https://hibernate.atlassian.net/browse/JPA-31 * https://hibernate.atlassian.net/browse/HHH-9165
Refer to the test-case at https://github.com/hibernate/hibernate-orm/commit/c354b5e8b9e157d46c08d3070de5d654e4e6cf11. Changing to use the native SQL
{code:sql} select * from Event where (:name is null or name = :name) {code}
Then set the parameter to null
{code:java} query.setParameter( "name", null ) {code}
It will then thrown : {code:java} Caused by: org.postgresql.util.PSQLException: 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. {code}
Change to use Hibernate specific API does not have such problem.
|
|