title: JPA: Database Generated columns
body: <p>I am facing an issue with Hibernate and JPA. My requirement is column <code>CreatedDTTM</code> and <code>LastUPDATEDDTTM</code> 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.</p>
  
  <pre><code>@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;
  </code></pre>