Hi I used Spring's HibernateTemplate to save entity, I also add call back method like this
@PrePersist
public void prePersist() {
setCreateDate(new Date());
}
but I found this callback annotation was not called when I called saveOrUpdate() method.
public void persist(Object entity) {
hibernateDaoSupport.getHibernateTemplate().saveOrUpdate(entity);
}
I found some post said that only use EntityManager will call these callback annotation method, is it right? If not, why my @PrePersist not being called. Could anybody give me a direction to investigate the problem, thanks a lot.