spring boot repository event handler
10 Sep 2016Spring boot is an awesome “wrapper” which allows Spring projects to be created and run with minimal configuration and it makes development fun again. While exploring Spring boot repositories, I needed to perform certain actions based on entities being created or deleted:
Defining a Spring Repository:
To capture events emitted when entities are created or destroyed:
The above class will execute the method whenever a User object is created. Similar annotations for deletions and updates exist.