Reading and querying against date values with Criteria API causing error

Description

An Entity that has Date field, is then searched against value from this field, this causes to throw PSQL error :Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: date = bytea
Wskazówka: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Pozycja: 119
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
at sun.reflect.GeneratedMethodAccessor256.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:455)
at $Proxy243.executeQuery(Unknown Source)
at com.sun.gjc.spi.jdbc40.PreparedStatementWrapper40.executeQuery(PreparedStatementWrapper40.java:641)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
at org.hibernate.loader.Loader.doQuery(Loader.java:802)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)

Error is probably caused, because the return type of Date filed is java.sql.Date or java.sql.Timestamp (this last works).

I will attach sample application.

Environment

PostgreSQL 8.4

Activity

Show:
rsmoguraN
September 17, 2010, 3:00 PM

This is WEB+EJB application to run http://localhost:8080/hibernate-bugs/bugs/2

Steve Ebersole
September 17, 2010, 3:29 PM

A better test case would be appreciated.

Steve Ebersole
October 3, 2013, 4:16 PM

No test case produced

Assignee

Unassigned

Reporter

rsmoguraN

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure