Hi,
I am using hibernate 3 with MySQL and was wondering how I can do a bulk insert from a ArrayList of hibernate objects. I googled and got many hits, but could not find a solution to my case. I want to generate a query like:
INSERT INTO sometable (col1, col2, col3) VALUES (1,2,3),(4,5,6),(7,8,9)
But everything I try with hibernate creates three SQL queries like this:
INSERT INTO sometable (col1, col2, col3) VALUES (1,2,3)
INSERT INTO sometable (col1, col2, col3) VALUES (4,5,6)
INSERT INTO sometable (col1, col2, col3) VALUES (7,8,9)
Anybodu knows how I can fix this?
Thank you!
Andrej
|