In case a value of a binded query parameter is null and is used with coalesce the following error is thrown: {quote}org.postgresql.util.PSQLException: ERROR: COALESCE types bytea and character varying cannot be matched{quote}
{code:java} TypedQuery<Person> query = entityManager.createQuery("from Person p where p.name = coalesce(:name , p.name) ", Person.class); query.setParameter("name", null); List<Person> resultList = query.getResultList(); {code} |
|