package com.rera.mss.model

import com.rera.mss.config.MEDIUM_STRING_FIELD_LENGTH
import javax.persistence.*

@Entity
@Table(name = "Sys_Entity")
data class SysEntity(
        @Id
        @Column(name = "entity_name", length = MEDIUM_STRING_FIELD_LENGTH)
        @GeneratedValue(strategy = GenerationType.AUTO)
        var entityName: String
){
    @OneToMany(mappedBy = "alternateId.entityName", cascade = [CascadeType.ALL], orphanRemoval = true)
    var stateEntityNames: MutableSet<SysState> = mutableSetOf()
}