티스토리 뷰

728x90

CreationTimestamp, UpdateTimestamp vs CreatedDate, LastModifiedBy

Spring Entity에서 시간을 나타낼 때 자주 사용하는 어노테이션이다.

두 그룹간 무슨 차이가 있고, 무엇을 써야할까?

CreationTimestamp, UpdateTimestamp CreatedDate, LastModifiedBy
- Hibernate 어노테이션
- ZoneDateTime 지원
- Spring어노테이션
- Spring Auditing
- @EnableJpaAuditing, @EntityListeners 어노테이션과 함께 사용됨
- ZoneDateTime 미지원

사실 어떤것을 사용하던 큰 차이가 없지만, 개인적으로 ZoneDateTime을 지원하는 CreationTimestamp, UpdateTimestamp를 더 자주 사용하는 편이다.

 

참고: 

https://stackoverflow.com/questions/66149224/whats-the-difference-between-creationtimestamp-and-createddate-in-spring-boot

https://logical-code.tistory.com/173

728x90
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31