title: Can't persist and entity using JPA and H2 database - sql parameter isn't be set on sql statement
body: <p>I have a simple JPA example and I'm trying to write an entity to an H2 database.</p>
  
  <p>Here is the error I am getting:</p>
  
  <pre><code> org.h2.jdbc.JdbcSQLException: Parameter "#2" is not set; SQL statement:
  insert into MyEntity (name, id) values (?, ?)`
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>EntityManagerFactory factory = Persistence.createEntityManagerFactory("thePersistenceUnit");
  EntityManager manager = factory.createEntityManager();
  manager.getTransaction().begin();
  MyEntity entity = new MyEntity();
  entity.setName("heyyy");
  manager.persist(entity);
  manager.getTransaction().commit();
  </code></pre>
  
  <p>My entity:</p>
  
  <pre><code>@Entity
  public class MyEntity {
      private String name;
  
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      private Integer id;
  
  
      public MyEntity() {
      }
  
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  </code></pre>
  
  <p>my persistence unit</p>
  
  <pre><code>&lt;persistence-unit name="thePersistenceUnit" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;class&gt;io.tcell.MyEntity&lt;/class&gt;
  
      &lt;properties&gt;
          &lt;property name="connection.driver_class" value="org.h2.Driver"/&gt;
          &lt;property name="hibernate.connection.url" value="jdbc:h2:/tmp/myh2db"/&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/&gt;
          &lt;property name="hibernate.hbm2ddl.auto" value="create"/&gt;
          &lt;property name="hibernate.show_sql" value="true" /&gt;
  
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>