Search Results

Search found 3 results on 1 pages for 'jpanewbie'.

Page 1/1 | 1 

  • Updatable false behvior incosistent

    - by jpanewbie
    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;

    Read the article

  • JPA: Database Generated columns

    - by jpanewbie
    Hello, I am facing an issue with Hiebrnate 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;

    Read the article

1