I am facing an issue with Hibernate and JPA. My requirement is column CreatedDTTM
and LastUPDATEDDTTM
should be populated at the DB level. I have tried following but no use. My columns are set NOT NULL. I get a "cannot insert Null into LastUpdatedDttm" exception. Any guidance is appreciated.
@Column(name="LAST_UPDATED_DTTM", insertable=false, updatable=false, columnDefinition="Date default SYSDATE")
@org.hibernate.annotations.Generated(value=GenerationTime.INSERT)
@Temporal(javax.persistence.TemporalType.DATE)
private Date lastUpdDTTM;
@Column(name="CREATED_DTTM”, insertable=false, updatable=false)
@org.hibernate.annotations.Generated(value=GenerationTime.ALWAYS)
@Temporal(javax.persistence.TemporalType.DATE)
private Date createdDTTM;