-->
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: passing sql values while calling update
PostPosted: Thu Aug 04, 2005 5:49 pm 
Newbie

Joined: Thu Aug 04, 2005 5:28 pm
Posts: 1
Here is the problem I am facing.
We have our Web app server in one time zone EST and our database server on another time zone CST. There is a requirement that when a record is updated the timestamp value for the 'modified_date' column needs to be the system time of the database server. This is essential because of some dependancies on other applications that use the database.

Since we are using hibernate the java object being updated is having a 'new Date()' assigned to the "modified_date' variable in it.

What should I do to the object/hibernate mapping/code so that database server system timestamp gets entered for the record when the object is updated(basically when update is called).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 5:52 pm 
Regular
Regular

Joined: Thu May 26, 2005 2:08 pm
Posts: 99
One way to do it would be to make a custom UserType that acts like a timestamp, but uses the Locale of your database server. I've done something similar for a field that uses a timestamp format unlike anything that's built-in.


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.