[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5576) Reading and querying against date values with Criteria API causing error

Radosław Smogura (JIRA) noreply at atlassian.com
Fri Sep 17 08:59:22 EDT 2010


Reading and querying against date values with Criteria API causing error
------------------------------------------------------------------------

                 Key: HHH-5576
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5576
             Project: Hibernate Core
          Issue Type: Bug
    Affects Versions: 3.6.0.CR1
         Environment: PostgreSQL 8.4
            Reporter: Radosław Smogura


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list