Dariusz on Software Quality

21/09/2009

ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

Filed under: en — Tags: , , , — dariusz.cieslak @

I was getting 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

3 Comments »

  1. 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);
    }

    Comment by wytten — 14/12/2010 @

  2. 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.

    Comment by dariusz.cieslak — 18/12/2010 @

  3. 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

    Comment by leonardo — 02/11/2011 @

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress