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: Updating last update time
PostPosted: Thu Jan 04, 2007 11:44 am 
Newbie

Joined: Fri Nov 17, 2006 1:00 pm
Posts: 6
Hi Guys,

I was wondering if there was an easier way to update the last update time column of a table.

Here is what I am doing right now:

I am first checking to see if the object already exists in the table. If it does not, then I insert the object as usual using save(). If it does exist, I have a seperate method where I re-set the last update time to the current time, and then call the update() method.

Doesn't this seem a bit too wordy for a simple task? Is there an easier way that I am missing?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 12:08 pm 
Regular
Regular

Joined: Thu Aug 17, 2006 4:50 am
Posts: 55
Location: Mallorca
You can use the saveOrUpdate method and a timestamp column


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.