Question : When I save a bean using the below statement .. Session.save(newPerson);
I observed from logs that, Hibernate issued separate insert statement to database (oracle) for all the associated beans as below ... Insert into Person Values() blob blob ; Insert into Sitemember blob blob ;
This is because , Person bean is associated to Sitemember class(one to many). Since we want these 2 inserts to go in one shot, I want to use native oracle sequel. One such oracle sequel is given below INSERT ALL INTO person (21866073, 'C','assigned name')" INTO Sitemember (41866074, 'requestor name','23')" SELECT * FROM dual" ;
I need your help to generate insert statements for the Person bean and Sitemember bean using any Hibernates functionality. Then I will make the batch insert sequel myself and execute that native query. Currently I am creating inserts statements manually. Please help.
|