-->
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.  [ 3 posts ] 
Author Message
 Post subject: Help with Update
PostPosted: Thu Mar 03, 2005 1:42 pm 
Regular
Regular

Joined: Tue Jan 11, 2005 8:55 pm
Posts: 53
Hi -

I am using Hibernate v2.1.7, and I have a question regarding update. Suppose I have a table, User, with numerous records already in the table. And suppose I want to update one of the fields in one of the records in the database. Is there a way to update without loading(retrieving) that record from the database and just updating that individual record.

I am aware of the 'dynamic-update' attribute which will only propagate the updated value, but even with this attribute, you still have to load the object initially. Is there a way to avoid doing this without loading the object? You can do it in pure JDBC, and I assume (or hope) there is a way to do it with Hibernate.

Basically, I want to do something like "update user.name where user.id = id", where I update only the user name and keep all the other fields the same (and not change to nulll)

I've searched the forum and there have been similar posts on this issue, and as well I have read the documentation on updating detached objects, updating, etc.

Any input would be appreciated!

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 1:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
In H3 there are batch update queries. In h2, you can only use direct JDBC


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 1:46 pm 
Regular
Regular

Joined: Tue Jan 11, 2005 8:55 pm
Posts: 53
michael wrote:
In H3 there are batch update queries. In h2, you can only use direct JDBC


Wow - that was quick. Thanks for the response!

Curious - is there an expected date for a stable release of Hibernate v3.0 ?


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