-->
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.  [ 4 posts ] 
Author Message
 Post subject: Bulk updates through Criteria interface
PostPosted: Thu Dec 16, 2004 12:21 pm 
Newbie

Joined: Thu Dec 16, 2004 7:50 am
Posts: 11
I would like to ask if someone considered the possibility to add some "bulk update" feature in hibernate. I mean if I would like to assign a lot of instances of some class the same value of one property I have to load them all from DB, change them one-by-one a also save them one-by-one. I think there should be more efficient way, because this could be done by one simple SQL statement. Something like an UpdateProperty method of criteria interface, so I could create the criteria object and then just change some property to specified value in one method call, which would result into one UPDATE command in SQL. Of course it would be nice to have the ability to use expresions and not just constant values and be able to change more properties in one UPDATE command, but I think that even the basic feature would be very useful. I know that I can accomplish this task by writing a direct SQL command by myself, by it would be really nice to be able to do such thing through hibernate, especialy if you have already the criteria object for this update prepared from some other operation. It would be very similar to the unofficial count() method of criteria interface (you can vote for this count() method on JIRA), just instead of SELECT COUNT(*) FROM table WHERE ... it would do UPDATE table SET prop = value WHERE ...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 1:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
there will be bulk update and delete in H3 (as per EJB3 spec)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 3:01 pm 
Newbie

Joined: Thu Feb 24, 2005 1:30 pm
Posts: 4
Location: Los Angeles
I didn't find document(s) for bulk update on H3's documents

_________________
--
Reza


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 4:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
documentation is in the progress of being updated.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.