package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain;

import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldCreate;
import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldUpdate;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.context.annotation.Profile;

import javax.persistence.*;

/**
 * <ul>
 * <li>업무 그룹명: 전자고지발송상세 테이블</li>
 * <li>설 명: </li>
 * <li>작성일: 2021. 12. 22. 오후 5:45:01
 * </ul>
 *
 * @author mk1126sj
 */
@Getter
@ToString
@Builder
@DynamicUpdate
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "tb_elctrn_ntic_sndng_detail", schema = "", catalog = "", indexes = {
        @Index(name = "idx_tcc_ens_detail_01", columnList = "external_document_uuid")
})
@Profile("prod-traffic")
public class ElctrnNticSndngDetail {


    @Id
    @Column(name = "elctrn_ntic_sndng_detail_id", length = 20)
    private String elctrnNticSndngDetailId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "elctrn_ntic_sndng_id")
    private ElctrnNticSndng elctrnNticSndng;

    @Column(name = "signgu_code", length = 5, columnDefinition = "char")
    private String signguCode;

    @Column(name = "main_code", length = 20)
    private String mainCode;

    @Column(name = "ihidnum", length = 100, updatable = false)
    private String ihidnum;

    @Lob
    @Column(name = "cn_detail")
    private String cnDetail;

    @Lob
    @Column(name = "mobile_page_cn")
    private String mobilePageCn;

    @Embedded
    private FieldCreate create;

    @Embedded
    private FieldUpdate update;

    @Column(name = "external_document_uuid", length = 40)
    @Setter
    private String externalDocumentUuid;
}
