File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/main/java/com/example/solidconnection/entity/common Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ networkTimeout=10000
55validateDistributionUrl =true
66zipStoreBase =GRADLE_USER_HOME
77zipStorePath =wrapper/dists
8+ org.gradle.jvmargs =-Dtime.nano-precision =6
Original file line number Diff line number Diff line change 1212import java .time .ZoneId ;
1313import java .time .ZonedDateTime ;
1414
15+ import static java .time .temporal .ChronoUnit .MICROS ;
16+
1517@ MappedSuperclass
1618@ EntityListeners (AuditingEntityListener .class )
1719@ Getter
@@ -24,12 +26,12 @@ public abstract class BaseEntity {
2426
2527 @ PrePersist
2628 public void onPrePersist () {
27- this .createdAt = ZonedDateTime .now (ZoneId .of ("UTC" ));
29+ this .createdAt = ZonedDateTime .now (ZoneId .of ("UTC" )). truncatedTo ( MICROS ); // 나노초 6자리 까지만 저장
2830 this .updatedAt = this .createdAt ;
2931 }
3032
3133 @ PreUpdate
3234 public void onPreUpdate () {
33- this .updatedAt = ZonedDateTime .now (ZoneId .of ("UTC" ));
35+ this .updatedAt = ZonedDateTime .now (ZoneId .of ("UTC" )). truncatedTo ( MICROS ) ;
3436 }
3537}
You can’t perform that action at this time.
0 commit comments