2 Replies Latest reply on Aug 6, 2009 11:55 AM by Suchong Sit

    Oracle 932 Error with AuditQuery.forRevisionsOfEntity

    Stephan Oudmaijer Newbie

      Hi there,

      I have a problem on Oracle 10g with the AuditQuery.forRevisionsOfEntity();

      If I set the param selectDeletedEntities to false, then an error on Oracle occurs.

      AuditQuery query = reader.createQuery().forRevisionsOfEntity(Contract.class, true, false);

      I get the following error:

      Hibernate: select contract_a0_.ID as ID11_, contract_a0_.REV as REV11_, contract_a0_.REVTYPE as REVTYPE11_, contract_a0_.AANTAL_PLAATSEN as AANTAL4_11_, contract_a0_.MUTATIE_STATUS as MUTATIE5_11_, contract_a0_.OVERDRACHT_CPT_BEHEER as OVERDRACHT6_11_, contract_a0_.DATUM_AANVANG as DATUM7_11_, contract_a0_.DATUM_EINDE as DATUM8_11_, contract_a0_.SOORT as SOORT11_ from CPT_CONTRACTEN_AUD contract_a0_ where (contract_a0_.REVTYPE<>? ) order by contract_a0_.REV asc
       [WARN] org.hibernate.util.JDBCExceptionReporter - [SQL Error: 932, SQLState: 42000]
       [ERROR] org.hibernate.util.JDBCExceptionReporter - [ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

      It has something to do with the param: contract_a0_.REVTYPE<>?

      My configuration:

      [INFO] org.hibernate.cfg.annotations.Version - [Hibernate Annotations 3.4.0.GA]
      [INFO] org.hibernate.cfg.Environment - [Hibernate 3.3.2.GA]
      [INFO] org.hibernate.cfg.Environment - [hibernate.properties not found]
      [INFO] org.hibernate.cfg.Environment - [Bytecode provider name : javassist]
      [INFO] org.hibernate.cfg.Environment - [using JDK 1.4 java.sql.Timestamp handling]
      [INFO] org.hibernate.annotations.common.Version - [Hibernate Commons Annotations 3.1.0.GA]
      [INFO] org.hibernate.ejb.Version - [Hibernate EntityManager 3.4.0.GA]
      [INFO] org.hibernate.cfg.SettingsFactory - [RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release - Production
      With the Partitioning, OLAP and Data Mining options]
      [INFO] org.hibernate.cfg.SettingsFactory - [JDBC driver: Oracle JDBC driver, version:]

      I am using Envers 1.2.1.GA