JPA에서 사용
@Getter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class Auditable {
@CreatedDate
@Column(name = "CREATED_AT")
private LocalDateTime createdAt;
@LastModifiedDate
@Column(name = "LAST_MODIFIED_AT")
private LocalDateTime modifiedAt;
}
@NoArgsConstructor
@Getter
@Setter
@Entity
// Auditable 상속하여 사용
public class Question extends Auditable {
...
}
@EnableJpaAuditing // 추가
@SpringBootApplication
public class PreProjectApplication {
public static void main(String[] args) {
SpringApplication.run(PreProjectApplication.class, args);
}
}
@ 22.09.04 추가
spring:
jpa:
hibernate:
jdbc:
time_zone : Asia/Seoul