목차

JPA Date Time

Joda Time

생성/수정 시간 (creation datetime, update datetime)

Hibernate 의 CreationTimestamp, UpdateTimestamp

@Column
@CreationTimestamp
private LocalDateTime createDateTime;
 
@Column
@UpdateTimestamp
private LocalDateTime updateDateTime;

DB DEFAULT 사용시

@Generated(GenerationTime.INSERT) 
@Column
private LocalDateTime createDateTime;
 
@Generated(GenerationTime.ALWAYS)  
@Column
private LocalDateTime updateDateTime;
created_at      DATETIME(6)  NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
modified_at     DATETIME(6)  NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),

Java 8 DateTime

Java 8 Year Month

참조