Make NotificationEventListener work in Hibernate 4

Hibernate 4 no longer register event listeners from `hibernate.cfg.xml`.
We have to write code to register event listeners.