title: Spring data jpa, how to write custom query for inserting multiple records in same table?
body: <p>Following is my table schema</p>
  
  <pre><code>CREATE TABLE Animals (
  
       id MEDIUMINT NOT NULL AUTO_INCREMENT,
       name CHAR(30) NOT NULL,
       PRIMARY KEY (id)
  ) ENGINE=MyISAM;
  </code></pre>
  
  <p>In mysql I can directly insert multiple records in one insert sql query. Like following.</p>
  
  <pre><code>INSERT INTO animals (name) VALUES('dog'),('cat'),('penguin'),('lax'),('whale'),('ostrich');
  </code></pre>
  
  <p>However, how can I achieve the same thing in spring data jpa.</p>
  
  <p>Right now I am using CrudRepository's  Iterable save(Iterable entities); and I am eneded up with 6 insert statements</p>
  
  <pre><code>insert into Animals (name) values (?)
  
  insert into Animals (name) values (?)
  
  insert into Animals (name) values (?)
  
  insert into Animals (name) values (?)
  
  insert into Animals (name) values (?)
  
  insert into Animals (name) values (?)
  </code></pre>
  
  <p>How do I restrict to One insert query ? Any answer will be helpful regarding spring data jpa, hql or jpql .</p>