package com.ecep.contract.model;

import java.io.Serializable;
import java.util.Objects;

import com.ecep.contract.CompanyFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import com.ecep.contract.vo.CompanyFileTypeLocalVo;

import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@Entity
@Table(name = "COMPANY_FILE_TYPE_LOCAL")
@ToString
public class CompanyFileTypeLocal extends BaseEnumEntity<CompanyFileType> implements Serializable, Voable<CompanyFileTypeLocalVo> {
    private static final long serialVersionUID = 1L;

    @Override
    public final boolean equals(Object object) {
        if (this == object)
            return true;
        if (object == null)
            return false;
        if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
            return false;
        }
        CompanyFileTypeLocal that = (CompanyFileTypeLocal) object;
        return getId() != null && Objects.equals(getId(), that.getId());
    }

    @Override
    public final int hashCode() {
        return HibernateProxyUtils.hashCode(this);
    }

    @Override
    public CompanyFileTypeLocalVo toVo() {
        CompanyFileTypeLocalVo vo = new CompanyFileTypeLocalVo();
        vo.setId(getId());
        vo.setType(getType());
        vo.setLang(getLang());
        vo.setValue(getValue());
        vo.setActive(false); // 设置默认值，因为实体中没有这个字段
        return vo;
    }
}
