-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to execute multiple inserts in one go in hibernate..
PostPosted: Mon Oct 05, 2009 11:31 am 
Newbie

Joined: Mon Oct 05, 2009 10:32 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.