eventlisteners using hibernate 4.0 with spring 3.1.0.release?

后端 未结 4 978
没有蜡笔的小新
没有蜡笔的小新 2020-11-27 05:00

These jars are both new released and have the latest solutions for Java EE applications. But I have a problem on specifiying hibernate listeners in hibernate.cfg.xml.

4条回答
  •  旧时难觅i
    2020-11-27 05:45

    You might wanna check the Hibernate Ticket [1]: https://hibernate.onjira.com/browse/HHH-6945

    The migration guide says:

    hibernate.cfg.xml no longer supported as means of specifying listeners. New approach invloves using an org.hibernate.integrator.spi.Integrator which works based on "service discovery".

    And you can get the complete instructions @ http://in.relation.to/Bloggers/EventListenerRegistration

    The links in the ticket have some issue, use the following:

    https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/main/java/org/hibernate/envers/event/EnversIntegrator.java

    https://github.com/hibernate/hibernate-orm/blob/master/hibernate-envers/src/main/resources/META-INF/services/org.hibernate.integrator.spi.Integrator

    Hope this helps someone looking answers for this problem.

提交回复
热议问题