Chronostamp adds magic timestamp fields to Models, like Ruby on Rails:
- created_at
- updated_at
- will add timestamp magic fields (created_at and updated_at) in an unobtrusive way.
- will automatically record creation and update timestamps of database objects.
- avoid inheritance coupling just for adding two attributes.
- avoid to write @MappedSuperclass for every single model.
- SpringPlugin has a priority of 1000 and it clashes with this one if it has a priority <= 1000, that’s why this plugin has a priority of 1001
Well it’s kind of easy, just add this module to your dependecy.yml file
If you have a legacy DB with tables that doesn’t have created_at and updated_at timestamp columns,
you can skip the creation of these magic timestamp fields by annotating the Model with
@NoChronostamp
If you control the creation of DB (Evolution, MyBatis Migrations, etc).
the timestamp columns must be of type TIMESTAMP
Start play in test mode play test and launch a browser to “http://localhost:9000/@tests”
Done!
You may find a sample app bundled with the module
This module is inspired on Ruby on Rails magic timestamp fields and Code snippet
Keep track of JPA record creation/updates
Author: Omar O. Román