Updatable false behvior incosistent

Posted by jpanewbie on Stack Overflow See other posts from Stack Overflow or by jpanewbie
Published on 2010-05-06T10:11:46Z Indexed on 2010/05/06 10:18 UTC
Read the original article Hit count: 328

Filed under:
|
|

I need LastUpdatedDttm to be updated by SYSDATE whenever record is updated. But below annoataions do nt work as desired. SYSDATE is inserted only once and not updated for subsequent updations. Also, lastUpdDTTM is not part of sql generated by hibernate.

@Generated(GenerationTime.ALWAYS)
@Column(name="LAST_UPDATED_DTTM",insertable=false,updatable=true, columnDefinition ="timestamp default SYSDATE")
private Date lastUpdDTTM;

@Generated(GenerationTime.ALWAYS)
@Column(name="CREATED_DTTM", insertable=false, updatable=false)
private Date createdDTTM;

© Stack Overflow or respective owner

Related posts about jpa

Related posts about java