30 lines
782 B
Kotlin
30 lines
782 B
Kotlin
package kr.co.vividnext.sodalive.content
|
|
|
|
import java.time.LocalDateTime
|
|
import javax.persistence.Entity
|
|
import javax.persistence.FetchType
|
|
import javax.persistence.GeneratedValue
|
|
import javax.persistence.GenerationType
|
|
import javax.persistence.Id
|
|
import javax.persistence.JoinColumn
|
|
import javax.persistence.ManyToOne
|
|
import javax.persistence.PrePersist
|
|
|
|
@Entity
|
|
data class ContentPriceChangeLog(
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
var id: Long? = null,
|
|
val prevPrice: Int,
|
|
var createdAt: LocalDateTime? = null
|
|
) {
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
|
@JoinColumn(name = "content_id", nullable = false)
|
|
var audioContent: AudioContent? = null
|
|
|
|
@PrePersist
|
|
fun prePersist() {
|
|
createdAt = LocalDateTime.now()
|
|
}
|
|
}
|