-->
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: Update certain fields using Hibernate
PostPosted: Sat Apr 14, 2007 11:29 am 
Newbie

Joined: Fri Mar 23, 2007 10:13 am
Posts: 8
How to make Hibernate only updates certain fields in database? I have a row of 10 fields, but I only want to update one of the fields by specifying the primary key, how should I do that using Hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 14, 2007 9:55 pm 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
You can use DML-style operations as defined here:

http://www.hibernate.org/hib_docs/v3/re ... tch-direct

One caveat: if you're using an L2 cache, the cache won't reflect the change. Just FYI.

Ryan-

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember 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.