package com.ecep.contract.model;

import jakarta.persistence.Column;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@MappedSuperclass
@ToString
public abstract class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", nullable = false)
    private Integer id;

    @Column(name = "TYPE")
    @Enumerated(EnumType.STRING)
    private T type;

    /**
     * Language
     */
    @Column(name = "LANG")
    private String lang;

    @Column(name = "VALUE")
    private String value;

}