-->
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: Issue of update record of mandatory
PostPosted: Mon Jun 19, 2006 4:28 am 
Newbie

Joined: Mon Jun 19, 2006 3:58 am
Posts: 2
In our project, each table have two field which use to record last update datatime and created datatime. about created time, i can set created datetime's value in method of Interceptor.onSave which will be callback before entity insert to database, but i can't find same method of update action. can you help me which method can be use?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 7:37 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
A more simpler way to do this would be to map last update datatime with a <timestamp> tag. Hibernate would update this field each time the record is updated. Do not set any value for this field in code. Using a <timestamp> tag will also allow you to use optimistic locking.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 1:28 am 
Newbie

Joined: Mon Jun 19, 2006 3:58 am
Posts: 2
Thank you, it is a very good solution for set lated update datatime. but in my project, i also need set lasted update by (record who update the record). this method can't solve this, so do you have other method?


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.