-->
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: Any easy way to update a column of all records
PostPosted: Mon May 26, 2008 9:48 pm 
Newbie

Joined: Wed Jan 31, 2007 9:55 pm
Posts: 16
I would like to update a column, Locked, of all records on a table, say Orders at day end to a specific value "N".

Is there any easy way to implement on hibernate? I don't want to select them first and then loop one by one to set the value and then update/save the value object. e.g.
1. "From OrdersVO o where o.locked = 'Y'"
2. Loop the Collection, change the value
3. Call SaveOrUpdate method

Any way like sql implementation, simply one statement like:
update Orders set Locked = 'N' on Hibernate?

Thanks!

Regards,
Mullin


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 26, 2008 11:54 pm 
Regular
Regular

Joined: Sun Apr 13, 2008 3:04 am
Posts: 71
Location: Bangalore
may be there is a equivalent HQL way to do the same.. this may be the ooad way do things rather than using native sql way which u already mentioned..

Any HQL experts pl..

Regards,
Nagendra

_________________
Raja Nagendra Kumar,
C.T.O
http://www.tejasoft.com
TejaSoft - Specialists in Code Audit, Unit Testing and Merciless Re-factoring - Engineering Crisis Turnaround Experts


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.