Reputation:
I'm trying to create a simple .java
class that simply runs and listens/watches a bunch of tables in a MySQL schema for any CRUD changes. How could I go about doing this? Would Hibernate have something that I could use?
Upvotes: 0
Views: 1973
Reputation: 2341
You can use a Hibernate Inceptor.
First implement the abstract class EmptyInterceptor. There are several methods to intercept, but for a CRUD I think you'll have to override onSave
, onLoad
and onDelete
.
Then register your interceptor on Hibernate configuration, method Configuration.setInterceptior
Upvotes: 0