title: Native List Insert query in Jpa/hibernate + Spring
body: <p>I want to insert a list of Objects in my db. In a special case I know that they primary key (not auto-generated) is not already there. Since I need to insert a big collection, the <code>save(Iterable&lt;Obj&gt; objects)</code> is to slow.</p>
  
  <p>Therefore I consider using a native query. <a href="https://stackoverflow.com/questions/24844306/native-insert-query-in-hibernate-spring-data">native insert query in hibernate + spring data</a></p>
  
  <p>In the previous answer, it does not say how to insert a collection of objects. Is this possible?</p>
  
  <pre><code>@Query("insert into my_table (date, feature1, feature2, quantity) VALUES &lt;I do not know what to add here&gt;", nativeQuery = true)
  void insert(List&lt;Obj&gt; objs);
  </code></pre>
  
  <p>Of course if you have a better solution overall, Its even better.</p>