title: JPA inserts and the dreaded ORA-01400: cannot insert NULL into tablename exception
body: <p>I've run into an interesting play on the infamous inserting null fields from the Entity into a database.</p>
  
  <p>Say I have the following table</p>
  
  <blockquote>
    <p>ID          |        Number(10)    | Not Null</p>
    
    <p>Some_Number  |       Number(25)   | Nullable</p>
    
    <p>Some_Date     |     DATE    Default(sysDate) | Nullable</p>
  </blockquote>
  
  <p>I have the following Entity</p>
  
  <pre><code>@Entity
  @Table(name="SOME_TABLE")
  public class MockEntity implements Serializable{
  
  private static final long serialVersionUID = 1L;
  @Id
  @Column(name="ID", nullable=false)
  private Long myId;
  @Column(name="SOME_NUMBER")
  private Long someNumber;
  @Column(name="SOME_DATE")
  private Date someDate;
  
  
  //Basic getters and setters here    
  </code></pre>
  
  <p>}</p>
  
  <p>The Perssitence Uint in my persistence.xml is as follows</p>
  
  <pre><code> &lt;persistence-unit name="someSortOfPU" transaction-type="RESOURCE_LOCAL"&gt;
        &lt;properties&gt;
           &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/&gt;
           &lt;property name="show_sql" value="true"/&gt;
           &lt;property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/&gt;
          &lt;property name="javax.persistence.jdbc.url" value="someUrl"/&gt;
           &lt;property name="javax.persistence.jdbc.user" value="someUser"/&gt;
          &lt;property name="javax.persistence.jdbc.password" value="somePassword"/&gt;
        &lt;/properties&gt;
     &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>The test case is persisting a MockEntity object with an ID and a Date, no SomeNumber is set</p>
  
  <pre><code>MockEntity testEntity = new MockEntity();
  testEntity.setMyId(999999l);
  testEntity.setSomeDate(new Date());
  </code></pre>
  
  <p>When I use the ojdbc14.jar with an Oracle 10g database, my junit gets the following error</p>
  
  <p>Caused by: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("SOME_TABLE"."SOME_NUMBER")</p>
  
  <p>When I use ojdbc14.jar with an Oracle 11g database, my junit completes successfully.  The row exists in the table.</p>
  
  <p>I've attempted to use the ojbc5.jars in hopes of having this issue disappear, but no luck.</p>
  
  <p>Does Oracle 10g interpret the Hibernate generated sql:</p>
  
  <pre><code>insert into SOME_TABLE (ID, SOME_NUMBER, SOME_DATE) values (?, ?, ?)
  </code></pre>
  
  <p>where the there is a null in the parameter passed to the statement differently than 11g, and how can I get the expected results on 10g?  </p>