@CreatedDate annotated field is not written on Insert, @LastModifiedDate is
问题 I created the following Entity and test it using h2: @Getter public class Topic { @Id private long id; private final Title title; @CreatedDate private LocalDateTime createdAt; @LastModifiedDate private LocalDateTime lastModified; // ... } The TopicRepository is an empty interface. The following test fails with the error that createdAt is null: @RunWith(SpringRunner.class) @SpringBootTest public class BasicRepositoryTests { @Autowired TopicRepository topicRepository; @Test public void