hard time setting autogenerated time with hibernate JPA annotations

前端 未结 2 1638
终归单人心
终归单人心 2020-12-25 14:08

thanks to you guys my knowlegde on hibernate has been improve dratiscally. now i hit a block here about current_timestamp. here is my codes

@Column(name=\"D         


        
2条回答
  •  没有蜡笔的小新
    2020-12-25 14:53

    You could achieve the same thing with hibernates @CreationTimestampand @UpdateTimestamp annotations e.g.

    @Column(name = "CREATED")
    @CreationTimestamp
    private LocalDateTime created;
    
    @Column(name = "LAST_UPDATED")
    @UpdateTimestamp
    private LocalDateTime lastUpdated;
    

提交回复
热议问题