Let me show you how it's easy peasy.
@CreationTimestamp
Marks a property as the creation timestamp of the containing entity. The property value will be set to the current VM date exactly once when saving the owning entity for the first time.
Usage Example:
@CreationTimestamp
@Column
@UpdateTimestamp
Marks a property as the update timestamp of the containing entity. The property value will be set to the current VM date whenever the owning entity is updated.
Usage Example:
@UpdateTimestamp
@Column
Note: You will have to import these two as well in your entity:
0 comments :
Post a Comment