title: Hibernate expected NUMBER got BINARY on null field
body: <p>I can't understand why Hibernate is trying to set this field as a VARBINARY when it is null.</p>
  
  <p>The Java data type is BigDecimal
  The Oracle data type is Float</p>
  
  <p>It is being set like this:</p>
  
  <pre><code>entityManager.createNamedQuery("blah").setParameter("target_field", object.sourceValue)
  </code></pre>
  
  <p>again - sourceValue is a BigDecimal, and when i debug it the value is null.</p>
  
  <p>when it tries to execute this update, I get oracle error: </p>
  
  <pre><code>ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
  </code></pre>
  
  <p>this is what shows up for this property in the console log:</p>
  
  <pre><code>o.h.type.descriptor.sql.BasicBinder      : binding parameter [8] as [VARBINARY] - [null]
  </code></pre>
  
  <p>IF I do this silly hack in Java before I execute the update:</p>
  
  <pre><code>if (object.sourceValue == null) object.sourceValue = new java.math.BigDecimal(0);
  </code></pre>
  
  <p>Then it runs fine. So the cause of this error is definitely not anything else than hibernate doing something wrong when the field is null.</p>
  
  <p>How do I fix this so I can set the field to null without hibernate mishandling it?</p>
  
  <p>In the DB, the field is nullable.</p>