title: inconsistent datatypes: expected NUMBER got BINARY
body: <p>I'm new to Hibernate, I'm trying to do a "simple" user insertion to oracle database I have created.</p>
  
  <p>I created all the necessary files with Netbeans Hibernate wizards:
  hibernate.cfg.xml, hibernate,reveng.xml, Users.hbm.xml, Users.java</p>
  
  <p>If I insert user with the oracle sql developer, I can get this user from java code. But if I'm trying to insert a user I get the error: inconsistent datatypes: expected NUMBER got BINARY.</p>
  
  <p>Partial Users.hbm.xml:</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
    &lt;class name="HibernateDB.Users" schema="SYSTEM" table="USERS"&gt;
      &lt;id name="userid" type="int"&gt;
        &lt;column name="USERID" precision="9" scale="0"/&gt;
        &lt;generator class="increment"/&gt;
      &lt;/id&gt;
      ...
  </code></pre>
  
  <p>Partial Users.java:</p>
  
  <pre><code>public class Users implements java.io.Serializable
  {
  
      private int userid;
      private String username;
      private String password;
      private String firstName;
      private String lastName;
      private Serializable dateOfBirth;
      private Serializable registrationDate;
      ...
  </code></pre>
  
  <p>Partial insertUser method (all parameters are strings):</p>
  
  <pre><code>    session = HibernateUtil.currentSession();
      Transaction tx = session.beginTransaction();
      Calendar dOfBirth = Calendar.getInstance();
      dOfBirth.set(Integer.parseInt(year_of_birth), Integer.parseInt(month_of_birth), Integer.parseInt(day_of_birth));
      Calendar regDate = Calendar.getInstance();
      Timestamp dOfBirthTS = new Timestamp(dOfBirth.getTimeInMillis());
      Timestamp regDateTS = new Timestamp(regDate.getTimeInMillis());
      Users user = new Users();
      user.setUsername(username);
      user.setPassword(password);
      user.setFirstName(first_name);
      user.setLastName(last_name);
      user.setDateOfBirth(dOfBirthTS);
      user.setRegistrationDate(regDateTS);
      session.saveOrUpdate(user);
      ans = user.getUserid();
      tx.commit();
  </code></pre>
  
  <p>Users Table in the database:</p>
  
  <pre><code>USERID NUMBER(9,0) - the primary key
  USERNAME VARCHAR(200)
  PASSWORD VARCHAR(200)
  FIRST_NAME VARCAHR(200)
  LAST_NAME VARCHAR(200)
  DATE_OF_BIRTH TIMESTAMP
  REGISTRATION_DATE TIMESTAMP
  </code></pre>