Hi all
I need to do a bulk insert of raw table data.
I need to use a Hibernate native query to insert the data.
I know how to do it using objects, but how can I do it using a native query ?
Code:
Session session = sessionFactory.openSession();
Transaction transaction = session.beginTransaction();
for (int i =0;i<100;i++)
{
EmployeeInfo employeeInfo = new EmployeeInfo();
employeeInfo.setSno(1);;
employeeInfo.setName("Value : "+String.valueOf(i));
session.save(employeeInfo);
if (i%50 == 0)
{
session.flush();
session.clear();
}
}
transaction.commit();
Michael