title: Batch insert using Native SQL in Hibernate
body: <p>I want to insert records in database using Hibernate Native SQL.The code is like below</p>
  
  <pre><code> Session session = sessionFactory.openSession();
   Transaction tx = session.beginTransaction();
  
  String sqlInsert = "insert into sampletbl (name) values (?) ";
  for(String name : list){
     session.createSQLQuery( sqlInsert )
            .setParameter(1,name)
            .executeUpdate();
  } 
  tx.commit();
  session.close();
  </code></pre>
  
  <p>Above code is working fine.I think it is not the best way.
  Please give me another possible ways to do this if any.
  Thank you</p>