I have created an abstract entity class to have only audit fields viz. createdDate and modifiedDate. I want hibernate to automatically generate values for these fields of type java.lang.Long
when respective queries are fired.
I am trying to use @CreationTimestamp
(org.hibernate.annotations.CreationTimestamp) but spring complains with following--
Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unsupported property type for generator annotation @CreationTimestamp
I have also tried @Temporal
but that does not work with fields of type Long
. I don't want to store date in java.util.Date
type.
Please help.