[Spring boot] @CreationTimeStamp null after update


[Spring boot] @CreationTimeStamp null after update

@Column(name = "CREATE_DT") @CreationTimestamp private LocalDateTime createDt; 기존에 createDt를 사용할 때 @CreationTimestamp을 사용해서 insert 할 때 자동으로 값이 생성되게 했다. 하지만 이 방식에는 문제가 존재하는데.. 똑같은 걸 한 번 더 save 하면 createDt가 null로 바뀌어버린다.. 처음 POST를 날리면 잘 들어가지만.. 한 번 더 날리면 null로 바뀐다. @CreationTimestamp column sets to null when I update it from POST method I'm trying to set a field in my database to write the date when a row is modified. To do that, I'm using the anotations provided by Hibernate. When I create the ro...


#CreationTimeStamp #스프링부트

원문링크 : [Spring boot] @CreationTimeStamp null after update