I want to add a custom FlushingEventListener in spring-boot .
When Hibernate Context flushes entities, I could execute my custom logic. I have tried to use @Compontent, but it does not work.
I think maybe Hibernate Context cannot use the beans of Spring. So how can I add a custom FlushingEventListener in spring-boot? On spring-boot-data-jpa, I find there are listeners and events, so I think maybe I can create a new instance of the listener in Hibernate.
This can be done automatically when saving.But I don’t know when the hibernate event fires.There are many different EventType in hibernate code.Where can I find documentation related to org.hibernate.event.spi.EventType.Find the documentation should help me better write the corresponding listener.Thank you vald.I want to know when EventType is triggered