I have a basic question on what Hibernate does under the hood. Assuming I have a parent object and a children collection in it. Both parent and child have their mapping files. When I add ‘n’ new objects to my collections and save the parent object, what happens?
A] ‘n’ separate INSERT queries are executed (May be 2*’n’ if the id is generated thru a sequence)
B] Only one batch query (PL/SQL) is executed which takes care of all the inserts.
I need to understand it because a update with huge number of new objects will result into a lot of round-trips.
Thanks,
Saurabh
|