Spring Roo Date Field with Current Timestamp

前端 未结 2 1889
暗喜
暗喜 2021-01-26 17:31

Most databases allow to have field with current timestamp (act as creation timestamp), for example in MySQL:

CREATE TABLE t (ts TIMESTAMP DEFAULT CURRENT_TIMESTA         


        
2条回答
  •  情话喂你
    2021-01-26 17:48

    This can be done as suggested by Simon, but it might be worth checking out a fuller solution.

    Check out this Spring Roo Timestamp add-on. It adds 'created' and 'updated' timestamps to all entities marked with its annotation. https://github.com/rcaloras/spring-roo-addon-timestamp

    (I created it, happy to answer questions or add additional features)

提交回复
热议问题