If the data is already saved in the DB (in other modelled tables, the ones from which you got your results), you can use the new "insert into ... select ..." HQL syntax, new to Hibernate 3.1.
If you're using anything older than 3.1, or you're constained to using an in-memory list, then you'll have to insert each item in the normal way (create an object and save it). Judicious use of Session.flush() and jdbc.batch_size can help improve performance a little, but using JDBC directly will be better for this sort of operation.
|