package com.icomsys.main_vm.db.jpa.entity.conversation;

import com.icomsys.main_vm.db.jpa.entity.conversation.id.TbSynonymWordId;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.naming.ldap.HasControls;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Table(name = "TB_SYNONYM_WORD")
@Entity
@Getter
@Setter
@NoArgsConstructor
//@IdClass(TbSynonymWordId.class)
public class TbSynonymWord {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SEQ", nullable = false, length = 20)
    private Long seq;
    @Column(name = "MASTER_SEQ", nullable = false, length = 20)
    private Long masterSeq;
    @Column(name = "OPR_MNG_CODE", nullable = true, length = 50)
    private String oprMngCode;
    @Column(name = "SYNONYM_WORD", nullable = true, length = 50)
    private String synonymWord;
    @Column(name = "IF_MAPPING_ID", nullable = true, length = 20)
    private Long ifMappingId;
    @Column(name = "USE_YN", nullable = true, length = 1)
    private String useYn;
    @Column(name = "REGIST_ID", nullable = false, length = 20)
    private String registId;
    @Column(name = "REGIST_DATE", nullable = false)
    private LocalDateTime registDate;
    @Column(name = "UPDATE_ID", nullable = true, length = 20)
    private String updateId;
    @Column(name = "UPDATE_DATE", nullable = true)
    private LocalDateTime updateDate;

    @Builder
    public TbSynonymWord(Long seq, Long masterSeq, String oprMngCode, String synonymWord, Long ifMappingId, String useYn, String registId, LocalDateTime registDate, String updateId, LocalDateTime updateDate) {
        this.seq = seq;
        this.masterSeq = masterSeq;
        this.oprMngCode = oprMngCode;
        this.synonymWord = synonymWord;
        this.ifMappingId = ifMappingId;
        this.useYn = useYn;
        this.registId = registId;
        this.registDate = registDate;
        this.updateId = updateId;
        this.updateDate = updateDate;
    }

    public TbSynonymWord updateSeq(Long masterSeq){
        this.seq = masterSeq;

//    public TbSynonymWord DeleteSynonymWord(){
//        this.useYn = "N";
        return this;
    }

}
