Guy van
I am working on a project developed in the Java EE 5 environment. I want to know how I can declare a Hibernate event listener so that I can be informed about the CRUD operation.
I read that I should declare something like this in the Hibernate *cfg.xml configuration file:
<hibernate-configuration> <session-factory> ... <event type="load"> <listener class="com.eg.MyLoadListener"/> <listener class="org.hibernate.event.def.DefaultLoadEventListener"/> </event> </session-factory> </hibernate-configuration>
The problem is that I do not have such a file in the project. We use JPA (with Hibernate as the base implementation). Do you know if I need to create this file? If so, where should I put it?
Thanks in advance.
java events listener hibernate jpa
user284400
source share