title: Where is the error in hibernate caused by ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
body: <p>I get an exception by hibernate:</p>
  
  <pre><code>java.sql.BatchUpdateException: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
  </code></pre>
  
  <p>What is exactly the error?
  I have the error in <code>tx.commit()</code> line:</p>
  
  <p>I only do:</p>
  
  <pre><code>Horario horario = new Horario();
  horario.setId(new HorarioId("correo",10,2));
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>tx = session.beginTransaction();
  session.save(horario);
  tx.commit();
  </code></pre>
  
  <p>and the class Horario is:</p>
  
  <pre><code>public class Horario implements java.io.Serializable {
  
      private HorarioId id;
      private Datos datos;
      private Serializable entrada;
      private Serializable salida;
  
      public Horario() {
      }
  </code></pre>
  
  <p>HorarioId is</p>
  
  <pre><code>public class HorarioId implements java.io.Serializable {
  
      private String email;
      private int semana;
      private int dia;
  
      public HorarioId() {
      }
  </code></pre>
  
  <p>thanks in advance</p>
  
  <p>I supposed that the hbm file is the next:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 14/12/2015 05:47:47 PM by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="hbm.Horario" table="HORARIO"&gt;
          &lt;composite-id name="id" class="hbm.HorarioId"&gt;
              &lt;key-property name="email" type="string"&gt;
                  &lt;column name="EMAIL" length="20" /&gt;
              &lt;/key-property&gt;
              &lt;key-property name="semana" type="int"&gt;
                  &lt;column name="SEMANA" precision="5" scale="0" /&gt;
              &lt;/key-property&gt;
              &lt;key-property name="dia" type="int"&gt;
                  &lt;column name="DIA" precision="5" scale="0" /&gt;
              &lt;/key-property&gt;
          &lt;/composite-id&gt;
          &lt;many-to-one name="datos" class="hbm.Datos" update="false" insert="false" fetch="select"&gt;
              &lt;column name="EMAIL" length="20" not-null="true" /&gt;
          &lt;/many-to-one&gt;
          &lt;property name="entrada" type="serializable"&gt;
              &lt;column name="ENTRADA" /&gt;
          &lt;/property&gt;
          &lt;property name="salida" type="serializable"&gt;
              &lt;column name="SALIDA" /&gt;
          &lt;/property&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>the relation of tables is:</p>
  
  <p><a href="https://i.stack.imgur.com/i4LIR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i4LIR.png" alt="enter image description here"></a></p>
  
  <p>and the columns of table Horario are:</p>
  
  <p><a href="https://i.stack.imgur.com/9Mocl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Mocl.png" alt="enter image description here"></a></p>