Envers: What is the recommended way to save the current state of all entities in an existing database?

We are introducing Hibernate Envers in our application.

Now, we want to store an initial revision of all out audited entities in the audit-tables. I thought I just could save the entities once via JPA, but Envers checks for modifications and does not save a new version.

I don’t want to make any arbitrary changes.

Is there a recommended way to create an initial version of all audited entities? Or force Envers to save a version even if there are no changes? Or something similar?

Or is SQL the only (and recommended?) way to do this?

1 Like