package com.dbnt.faisp.translator.model;

import com.dbnt.faisp.authMgt.model.AccessConfig;
import com.dbnt.faisp.authMgt.model.ApprovalConfig;
import com.dbnt.faisp.codeMgt.model.CodeMgt;
import com.dbnt.faisp.config.BaseModel;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import javax.persistence.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "translator_info")
@IdClass(Translator.TranslatorId.class)
public class Translator extends BaseModel implements Serializable{
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name = "translator_key")
  private Integer translatorKey;
  @Id
  @Column(name = "version_no")
  private Integer versionNo;
  @Column(name = "ogdp1")
  private String ogdp1;
  @Column(name = "tr_lang")
  private String trLang;
  @Column(name = "tr_career")
  private String trCareer;
  @Column(name = "tr_name")
  private String trName;
  @Column(name = "tr_sex")
  private String trSex;
  @Column(name = "tr_phone")
  private String trPhone;
  @Column(name = "tr_nny")
  private String trNny;
  @Column(name = "tr_age")
  private String trAge;
  @Column(name = "tr_edu")
  private String trEdu;
  @Column(name = "tr_cft")
  private String trCft;
  @Column(name = "tr_visa")
  private String trVisa;
  @Column(name = "apt_dt")
  private String aptDt;
  @Column(name = "dml_yn")
  private String dmlYn;
  @Column(name = "remark")
  private String remark;
  @Column(name = "wrt_nm")
  private String wrtNm;
  @Column(name = "wrt_dt")
  private LocalDateTime wrtDt;
  @Column(name = "wrt_organ")
  private String wrtOrgan;
  
  
  
  
@Override
public String toString() {
	return "Translator [translatorKey=" + translatorKey + ", versionNo=" + versionNo + ", ogdp1=" + ogdp1 + ", trLang="
			+ trLang + ", trCareer=" + trCareer + ", trName=" + trName + ", trSex=" + trSex + ", trPhone=" + trPhone
			+ ", trNny=" + trNny + ", trAge=" + trAge + ", trCft=" + trCft + ", trVisa=" + trVisa + ", aptDt=" + aptDt
			+ ", dmlYn=" + dmlYn + ", remark=" + remark + ", wrtNm=" + wrtNm + ", wrtDt=" + wrtDt + "]";
}

@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class TranslatorId implements Serializable {
  private Integer translatorKey;
  private Integer versionNo;
}


}
