In my previous article Spring Data JPA Auditing: Saving CreatedBy, CreatedDate, LastModifiedBy, LastModifiedDate automatically , I have discussed why Auditing is important for any business application and how we can use Spring Data JPA automate it. I have also discussed how Spring Data uses JPA’s EntityListeners and callback methods to automatically update CreatedBy , CreatedDate , LastModifiedBy , LastModifiedDate properties. Well, here in this article I am going dig a little bit more and discuss how we can use JPA EntityListeners to create audit logs and keep information of every insert, update and delete operation on our data. I will take the File entity example from the previous article and walk you through the necessary steps and code portions you will need to include in our project to automate the Auditing process. We will use Spring Boot, Spring Data JPA (Because it gives us complete JPA functionality plus some nice customization by Spring), MySql to demonstrate this. We wi...
Naresh Joshi's blog for Java Language, Spring, Hibernate, Struts, Web Services, Micro Services, Design Patterns, Multi-threading, Collection XML, SQL.