Hibernate Exception : Expected NUMBER got BINARY

843859

    Why am i getting this exception :
    I had it earlier also in a small example, but somehow got rid of it, by using 'assigned' mechanism for PK generation. But right now i am using 'native' mechanism for PK generation. Does this error occur because a Java null value is being put in a property for hibernate which expects a particular data of a particular type ?


    Hibernate version: 3.1

    Full stack trace of any exception that occurs:

    2006-03-15 15:35:59 ERROR MessageID(CCG-PDC-Workflow,PACS-ADT.1.159,admitPatient) "Workflow Exception" [com.ge.medit.pdm.messaging.Dispatcher]
    com.ge.medit.pdm.dao.DataAccessException: Failed to commit transaction
    at com.ge.medit.pdm.dao.ServiceLocator.commitTransaction(ServiceLocator.java:245)
    at com.ge.medit.pdm.dao.TransactionManager.commitTransaction(TransactionManager.java:12)
    at com.ge.medit.pdm.messaging.workflow.PatientWorkflowManager.admitPatient(PatientWorkflowManager.java:94)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ge.medit.pdm.messaging.services.WorkflowService.handleMessage(WorkflowService.java:57)
    at com.ge.medit.pdm.messaging.Dispatcher.dispatch(Dispatcher.java:160)
    at com.ge.medit.pdm.messaging.WorkerThread.run(WorkerThread.java:90)
    Caused by: org.hibernate.exception.SQLGrammarException: could not insert: [com.ge.medit.pdm.hibernate.valueobjects.Patient]
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2078)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2427)
    at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
    at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
    at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
    at com.ge.medit.pdm.dao.ServiceLocator.commitTransaction(ServiceLocator.java:240)
    ... 9 more
    Caused by: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2065)
    ... 20 more

    Name and version of the database I am using:
    Oracle 10g