-->
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: SQL or Load an object ?
PostPosted: Mon Sep 29, 2008 10:13 am 
Beginner
Beginner

Joined: Fri Feb 29, 2008 9:36 am
Posts: 40
Hi,

If I need to update one field value for a row, with SQL, it's easy to do
UPDATE MyTable SET MyColumn := A WHERE Id := B

With NHbernate, today, I load an object, I modify the desired value and I save the object.

Is it possible with NHibernate to do a simple update query like first of my post ?

Thanks,

Papy


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2008 10:32 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
With NHIbernate 2.0 there should be a session.ExecuteUpdate() method. Haven't used it yet, but check either the source code or the documentation.

http://groups.google.com/group/nhusers/files

_________________
--Wolfgang


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.