how to save creation and updation timestamp with hibernate

realNameHidden - Oct 24 '22 - - Dev Community

Object time stamping feature of hibernate

->this feature keeps track of the object/record is saved/inserted initially

later it also keeps track of when record/object is lastly updated/modified

=>Object versioning feature keeps track how many times the object/record is modified using

Hibernate persistence logic where Object timestampping feature keeps track when exactly the Object/record

is inserted and lastly updated.

for Detailed explanation you can watch the video

*useCases for timeStampping
*

->Keeping the track of when the password lastly changed

->keeping the track of when stock market share values lastly updated/modified

->Keeping the track of when last tx happend in the bank account

In annotation driven HB programming

->we can enable timestamp,version features at a time on single entity class

-> in timestamp feature we can take seperate col/property holding the object/record

insertion date and time and another seperate property holding object/record last updation

date and time

**
@CreationTimeStamp

@UpdationTimeStamp
**

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .