Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
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
Tags
more
Archives
Today
Total
관리 메뉴

메모장

JPA @PrePersist, @PreUpdate 본문

Java

JPA @PrePersist, @PreUpdate

doopang 2022. 11. 22. 14:19
// 생성되는 시점에 수행
@PrePersist
public void preInit() {
  this.createdDate = LocalDateTime.now();
  this.modifiedDate = LocalDateTime.now();
}

// 업데이트 되는 시점에 수행
@PreUpdate
public void preUpdate() {
  this.modifiedDate = LocalDateTime.now();
}

'Java' 카테고리의 다른 글

JPA 저장된 정렬 정보 이용하여 리스트 조회  (0) 2022.12.07
소수점 0 제거  (0) 2022.11.24
엑셀 POI  (0) 2022.11.10
JPA Entity > Repository  (0) 2022.09.30
JPA Transaction 분리하고 싶을 때  (0) 2022.04.10