-->
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.  [ 2 posts ] 
Author Message
 Post subject: Multiple updates
PostPosted: Fri Sep 26, 2003 4:21 am 
Newbie

Joined: Fri Sep 26, 2003 4:08 am
Posts: 1
Hello,

I need to update to B a property of all of the objects of certain class which have this property set to A. I could have a great collection of those objects. In SQL I can execute this statement:

UPDATE the_table SET the_field = B WHERE the_field = A;

The only way that I could think to do it in Hibernate is to load the collection of the_table where the_field = A and then execute an update for each element of the collection. On great collections this method will be extermely unefficient.

Could you give me some advice?
Thank you.
Tatiana


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2003 8:09 am 
Regular
Regular

Joined: Mon Sep 08, 2003 4:53 am
Posts: 70
Location: Germany
I think the best way to do this is using JDBC. You could get the JDBC connection from the Hibernate session via

Connection con = session.connection();


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

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.