-->
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: Updating Multiple records using Hibernate
PostPosted: Fri Sep 29, 2006 4:30 am 
Newbie

Joined: Fri Aug 04, 2006 5:54 am
Posts: 6
Hi,

I am new to hibernate. I am using Hibernate 2.8. And I have a requirement that I need to update multiple records in a table using hibernate. Just as we write a simple SQL query to update multiple records - Update <table> set <column> = <value> where <field> in (value1,value2). How do i perform the above task using hibernate.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 8:46 am 
Senior
Senior

Joined: Wed Aug 17, 2005 12:56 pm
Posts: 136
Location: Erie, PA (USA)
Hibernate 3 supports DML-style HQL (i.e. UPDATE ...); unfortunately for you, H2 does not. Your choices are:
- Upgrade to H3;
- Retrieve and iterate over a list and update each;
- Use SQL thru a JDBC call (note: you can get the connection from Hibernate [Session.connection]).

Curtis ...

_________________
---- 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.  [ 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.