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.  [ 5 posts ] 
Author Message
 Post subject: How to execute this UPDATE SQL Statement to update multiple
PostPosted: Tue Jan 27, 2009 11:35 am 
Newbie

Joined: Wed Dec 10, 2008 2:14 pm
Posts: 17
Hi,
I want to execute one update Statement using hibernate.

I have to execute this query.
"Update Table1 set column1 = 0 WHERE ID=2"

This statement updates more then one rows in Table1.

Can someone tell me what is the syntex to execute this statement?

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 2:36 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
In 2.0 there should be a session.ExecuteUpdate() methode. I haven't used it yet, since I'm still on 1.2. If you also use a version before 2.0 you have to build your own IDbCommand (session.Connection.CreateCommand()).

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2009 12:26 pm 
Newbie

Joined: Wed Dec 10, 2008 2:14 pm
Posts: 17
Thanks for your reply,
But is it possible to post an example how to achieve this ?

I am looking for some example to do like this/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2009 5:40 am 
Newbie

Joined: Wed Feb 20, 2008 10:45 am
Posts: 10
What version of NH are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2009 11:00 am 
Newbie

Joined: Wed Dec 10, 2008 2:14 pm
Posts: 17
I am using 2.2


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