![]() You also need to create an audit table for each entity you want to audit. I will show you how to add more information to this table, like the user who created the revision, in one of the following blog posts. CREATE TABLE revinfoĬONSTRAINT revinfo_pkey PRIMARY KEY (rev) By default, Hibernate persists only the revision number as an integer and the creation timestamp as a long. This table stores the revision information. So, here are the tables you need to create in your database setup or migration script: REVINFO You can use that feature to create your database script, but you shouldn’t deploy it to production without reviewing and improving it. Hibernate can do that itself, if you use the automatic schema generation feature. The next thing you need to do is to setup the audit tables. If you’re using maven, you can do that with the following maven dependency. You just have to add the hibernate-envers.jar file to the classpath. It’s pretty easy to add Hibernate Envers to an existing application. 3.2 Get active revision at a given date.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |