Hi everyone,
Can someone give me some good suggestions on how to perform an efficient bulk insert by using hibernate?? I don't want to use straight SQL because my application will support multiple database and I don't want to create individual SQL for each platform plus the bulk insert statement changes according to user request. What is the best way to do an efficient bulk insert by using Hibernate to simulate something like the following SQL statement without using static SQL:
INSERT INTO TABLE_1(VALUE1, VALUE2, VALUE3) SELECT
TABLE_2.VALUE1, TABLE_2.VALUE2, TABLE_3.VALUE3 FROM TABLE_2, TABLE_3
WHERE TABLE2.ID = TABLE_3.ID AND TABLE_2.VALUE4 = 'SOMETHING'. AND TABLE_3.VALUE5 = 'SOMETHING'
This is just an example SQL and the application uses different SELECT statement in the bulk insert.
Thanks
Vivian
|