title: NULL not allowed for column "ID" H2 Hibernate
body: <p>I am using Java EE with Wildfly 12. I have the following SQL table scheme:</p>
  
  <pre><code>CREATE TABLE AUTHOR ("ID" INTEGER primary key, "FIRSTNAME" VARCHAR(50) not null, "SECONDNAME" VARCHAR(50) not null);
  CREATE TABLE BOOK ("ID" INTEGER primary key, "TITLE" VARCHAR(50) not null, "AUTHOR" INTEGER, FOREIGN KEY ("AUTHOR") REFERENCES AUTHOR("ID"));
  </code></pre>
  
  <p>I want to execute the following insert:</p>
  
  <pre><code>INSERT INTO AUTHOR("SECONDNAME","FIRSTNAME") values ('a', 'b');
  INSERT INTO BOOK("TITLE","AUTHOR") values ('bookTitle', 1);
  </code></pre>
  
  <p>My persistence.xml:</p>
  
  <pre><code>&lt;property name="hibernate.hbm2ddl.auto" value="create-drop" /&gt;
  &lt;property name="hibernate.show_sql" value="true" /&gt;
  &lt;property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/&gt;
  &lt;property name="javax.persistence.schema-generation.create-source" value="script"/&gt;
  &lt;property name="javax.persistence.schema-generation.drop-source" value="script"/&gt;
  &lt;property name="javax.persistence.schema-generation.create-script-source" value="META-INF/create.sql"/&gt;
  &lt;property name="javax.persistence.schema-generation.drop-script-source" value="META-INF/drop.sql"/&gt;
  &lt;property name="javax.persistence.sql-load-script-source" value="META-INF/load.sql"/&gt;
  </code></pre>
  
  <p>This works when I explicitly insert ID. However, the ID has to be auto-generated. My entity classes:</p>
  
  <pre><code>@Entity
  @XmlRootElement
  public class Author {
  
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      private Long id;
  
  // rest of fields, getters, and setters omitted
  
  }
  
  @Entity
  @XmlRootElement
  public class Book {
  
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      private Long id;
  // Again, rest of the fields, getters and setters omitted
  }
  </code></pre>
  
  <p>I've tried all generation strategies (AUTO, IDENTITY, SEQUENCE). As I said, if I explicitly set IDs in my SQL, the SQL works, but I encounter the same problem when using entityManager.persist...</p>
  
  <pre><code>@POST
  @Path("/create")
  public void createAuthor(Author author) {
      entityManager.persist(author);
  }
  </code></pre>
  
  <p>All of the above gives me:</p>
  
  <pre><code>Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column "ID"; SQL statement: ...
  </code></pre>
  
  <p>Any help?</p>