File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/kotlin/me/nalab/api/core Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -15,21 +15,21 @@ abstract class TimeBaseEntity {
1515 nullable = false ,
1616 updatable = false ,
1717 )
18- protected var createdAt: Instant ? = null
18+ protected lateinit var createdAt: Instant
1919
2020 @Column(name = " updated_at" , columnDefinition = " TIMESTAMP(6)" , nullable = false )
21- protected var updatedAt: Instant ? = null
21+ protected lateinit var updatedAt: Instant
2222
2323 @PrePersist
2424 fun prePersist () {
25- val now = Instant .now()
26- createdAt = if (createdAt != null ) createdAt else now
27- updatedAt = if (updatedAt != null ) updatedAt else now
25+ val now = TimeUtil .now()
26+ createdAt = now
27+ updatedAt = now
2828 }
2929
3030 @PreUpdate
3131 fun preUpdate () {
32- updatedAt = Instant .now()
32+ updatedAt = TimeUtil .now()
3333 }
3434}
3535
You can’t perform that action at this time.
0 commit comments