I am trying do it throught this blog steps.
http://leakfromjavaheap.blogspot.com.es/2013/08/prepersist-and-preupdate-not-working.html
But starting from Hibernate 4.3, events package in hibernate-entitymanager.jar are removed.
In another hand, I had been reading about interceptors and events. http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html_single/#events
Are this only two ways to implement @PrePersist behaviour? or could use @EntityListeners annotation with SessionFactory?. Although I would prefer win @PrePersist annotation compatibility.
Thank you in advance.