In my Entity class there are fields like dateCreated and dateUpdated. To auto-update these fields, I annotated dateCreated field with @PrePersist and dateUpdated field with @PreUpdate. It worked out for me. On creating a new entity, the dateCreated field gets updated but while updating the entity the dateCreated field becomes null and dateUpdated field gets updated. Can anyone please tell why this is happening?
I am using Hibernate 4.3.6 version and JPA 2.0