title: Hibernate generates invalid SQL query with MySQL
body: <p>I have the following JPA entity classes (example case). A House belongs on a single Street. A Street has many Houses.</p>
  
  <pre><code>@Entity
  public class House {
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      public Integer id;
  
      public String name    
  
      @ManyToOne
      public Street street;
  }
  
  @Entity
  public class Street {
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      public Integer id;
  
      @OneToMany(mappedBy="street")
      public Set&lt;House&gt; houses;
  }
  </code></pre>
  
  <p>I have the generation type set to identity, which is supposed to auto assign a new ID.</p>
  
  <p>When creating a new House with a new Street, I have to first create and persist Street, followed by House. This is because I do not have CascadeType set to PERSIST, so it has to be done manually [1]. However, while inserting a newly created Street:</p>
  
  <pre><code>Street street = new Street();
  entityManager.persist(street);
  </code></pre>
  
  <p>Hibernate/JPA generates the following SQL query:</p>
  
  <pre><code>insert into Street default values
  </code></pre>
  
  <p>which MySQL doesn't like.</p>
  
  <pre><code>Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default values' at line 1 
  </code></pre>
  
  <p>Any ideas why? I'm using Java 6, MySQL 5.0.67 with Hibernate's implementation of JPA (version 3.2.1.ga).</p>
  
  <p>[1] EJB 3 in Action pages 318-319</p>