title: JPA/Hibernate improve batch insert performance
body: <p>I have a data model that has a ONE TO MANY relationship between ONE entity and 11 other entities. These 12 entities together represent one data packet. The problem I am having is to do with the number of inserts that occur on the 'many' side of these relationships. Some of them can have as many as 100 individual values so to save one whole data packet in the database it requires up to 500 inserts. </p>
  
  <p>I am using MySQL 5.5 with InnoDB tables. Now, from testing the database I see that it can easily do 15000 inserts per second when processing a batch insert (and even more with LOAD DATA, but that's not practical for this case).</p>
  
  <p>Is there some way to bunch up these individual 500 inserts into, say - 5 inserts with 100 VALUES (for the 5 linked entities that each has 100 values) using Hibernate?</p>
  
  <p>As Requested: </p>
  
  <pre><code>@OneToMany(mappedBy="beat", cascade=CascadeType.ALL)
  @OrderBy("miliseconds ASC")
  public List&lt;AmbientLight&gt; lights;
  </code></pre>
  
  <p>I should probably also mention one important piece of information - I am using <strong>Play! Framework 1.2.3</strong></p>