paulcwarren / spring-content-with-envers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Content Envers Example

Notes

  • The project's dependencies include spring-data-envers. This provides a spring data (java only) API on top of hibernate envers feature.
  • The FileRepository extends RevisionRepository giving it an API for retrieving Revisions.
  • The File entity is annotated as @Audited. This tells hibernate to create additional tables and record revisions of the entity as it is modified over time.
  • GenericRevisionController is an implementation of a generic controller providing rest endpoints on top of the spring-data-envers java API.
  • AuditedSetContentEventHandler is a spring content event handler bean that resets the content id so that it is regenerated when content is set. This is important so that revision content can be fetched later on. It is added to the application context here.

Running the tests

mvn clean test

About


Languages

Language:Java 85.6%Language:HTML 7.3%Language:JavaScript 7.1%