ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

I got the following error:

ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

on line:

<property name="customer" column="CustomerId" />

the fix for above error was to use many-to-many tag instead of plain <property>:

<many-to-one name="customer" column="CustomerId" />

Note that class is not required here – it's computed from return type of getCustomer() getter by reflection.

hibernate_logo_a

This entry was posted in en and tagged , , , . Bookmark the permalink.

5 Responses to ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

  1. wytten says:

    This exception is not very helpful at all!
    In my case I found that passing value==null into the Spring DAO method below produced the same exception.

    public List findByProperty(String propertyName, Object value){
    String queryString = "from biz.Payment as model where model."
    + propertyName + "= ?";
    return (List)getHibernateTemplate().find(queryString, value);
    }

  2. dariusz.cieslak says:

    Probably biz.Payment.propertyName field is a primitive type (int), not wrapper (java.lang.Integer). That's why null is not allowed here. Indeed, the exception is very misleading.

  3. leonardo says:

    hi dariusz btw im getting this error "expected Number got Binary" how do i solve this problem because im getting stuck in this case in few days
    help me out please
    thanks gb

  4. roger says:

    Yeah probably caused by null pointer here as well, thanks for the tip!

  5. Pingback: peter

Comments are closed.