generated from pricelees/issue-pr-template
[#35] 결제 스키마 재정의 & 예약 조회 페이지 개선 #36
@ -33,3 +33,22 @@ abstract class BaseEntity(
|
||||
abstract override fun getId(): Long?
|
||||
|
||||
}
|
||||
|
||||
@MappedSuperclass
|
||||
abstract class PersistableBaseEntity(
|
||||
@Id
|
||||
@Column(name = "id")
|
||||
private val _id: Long,
|
||||
|
||||
@Transient
|
||||
private var isNewEntity: Boolean = true
|
||||
): Persistable<Long> {
|
||||
@PostLoad
|
||||
@PostPersist
|
||||
fun markNotNew() {
|
||||
isNewEntity = false
|
||||
}
|
||||
|
||||
override fun isNew(): Boolean = isNewEntity
|
||||
override fun getId(): Long = _id
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user