Skip to content

Commit

Permalink
🗃️BaseEntity activation
Browse files Browse the repository at this point in the history
  • Loading branch information
jun108059 committed Sep 22, 2024
1 parent 16f1ee1 commit a6039e8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/kotlin/nexters/weski/WeskiApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package nexters.weski

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.data.jpa.repository.config.EnableJpaAuditing

@SpringBootApplication
@EnableJpaAuditing
class WeskiApplication

fun main(args: Array<String>) {
Expand Down
21 changes: 21 additions & 0 deletions src/main/kotlin/nexters/weski/common/BaseEntity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package nexters.weski.common

import jakarta.persistence.*
import org.springframework.data.annotation.CreatedDate
import org.springframework.data.annotation.LastModifiedDate
import org.springframework.data.jpa.domain.support.AuditingEntityListener
import java.time.LocalDateTime

@MappedSuperclass
@EntityListeners(AuditingEntityListener::class)
abstract class BaseEntity {

@CreatedDate
@Column(updatable = false)
var createdAt: LocalDateTime? = null
private set

@LastModifiedDate
var updatedAt: LocalDateTime? = null
private set
}

0 comments on commit a6039e8

Please sign in to comment.