package gaf3.core.jpa

import gaf3.core.jpa.annotation.WithIgnorePath
import javax.persistence.Column
import javax.persistence.MappedSuperclass
import javax.persistence.PrePersist

@MappedSuperclass
abstract class GafSortedTimestamp: GafTimestamp(), GafSortable {
    @PrePersist
    open fun insertOrder() {
        orderNum = orderNum ?: 0
    }

    @WithIgnorePath
    @Column(name = "ORDER_NUM")
    override var orderNum: Int? = null
}