Spring Boot JPA@CreatedDate @LastModifiedDate not being populated when saving the object

后端 未结 4 1177
南笙
南笙 2021-01-17 23:21

I am writing an app with Spring Boot + JPA, using a Postgres database. I have a User Entity and I am trying to get a timestamp when the user record is saved and/or modified.

4条回答
  •  鱼传尺愫
    2021-01-17 23:48

    I had similar issue, but the reason for my case is that I had @Transactional annotation on the test class, after removing that, everything works as expected.

提交回复
热议问题