title: The column "ID" cannot be null with hibernate
body: <p>I created the entity patient with a column <code>ID</code> which is the primary key of the table <code>PATIENT</code>. While inserting a new <code>Patient</code> object, I get the following exception:</p>
  
  <pre><code> WARN: SQL Error: -20001, SQLState: 23502
   org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
   The column "ID" cannot be null.
  </code></pre>
  
  <p>This is the code creating the <code>Patient</code> object:</p>
  
  <pre><code>    SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
      Session session = sessionFactory.openSession();
      Patient patient = new Patient(1L, null, "John", "Kennedy", 12, "USA", "Wall Street");
  
      session.save(patient);
  </code></pre>
  
  <p>The value id of the <code>Patient</code> object is 1.</p>
  
  <p>I am using struts with Tomcat 6 and Derby 10.9.1.0 and Hibernate 4.</p>
  
  <p>Any help</p>