Postgres / hibernate operator does not exist: text = bytea

Usually this error is from Hibernate serializing a not-otherwise-mapped class (resulting in a bytea) and comparing that to a String (probably given by you in a query).

Map the Date! Use @Temporal(Date) on the Date attribute. I don't know how to express that in hbm.xml notation.


It is weird but the query does not handle null very well. When I changed the query to:

Query query = getSession().createQuery("from Car as c where " +
"c.carModel = ? AND c.carMake is null").setParameter(0, carModel);

it works fine since the DAO needs to query the make as NULL. So if it is not null, I need to have two sets of query, one that is hardcoded to select null as above, other to setParam(1, carMake).

Weird but I think this works.


Use Query.setParameterList instead of setParameter solved my problem for an integer array (integer = bytea)