Skip to content

ksarath/envers-audit-query-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Envers Audit Query Example

In this example you can see how to use Envers for Auditing your tables.

This is a Spring Boot Application and it is configured with h2 (in-memory) database.

There are the following entities:

  1. AuditEnversInfo --> auditory master table
  2. User --> User table
  3. UserOrganisations --> User Organisation mapping table with preferred attribute
  4. Organisation --> Organisation

For each table (entity) the framework will create the auditory tables.

How to run?

  1. Since the current version, it is not necessary create manually the schema, when the application startup, it will create the schema and the entities.

  2. Compile the project with the following command:

    mvn clean install
    
  3. You can run the application inside of your ide from com.envers.ExampleEnversApplication.java or from terminal with the following command:

    mvn spring-boot:run
    

Rest endpoints

I used the postman as a client to test the endpoints, you can import the collection, the file is in:

/resources/endpoints/envers-audit-query-v1.postman_collection.json

Or if you prefer, you can see the Controllers inside of com.envers.web

About

Hibernate Envers AuditQuery Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages