package com.dbnt.sims.translator.model;

import com.dbnt.sims.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.format.annotation.DateTimeFormat;

import javax.persistence.*;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;


@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@IdClass(Translator.TranslatorId.class)
@Table(name = "translator_info")
public class Translator extends BaseModel implements Serializable{
  @Id
  @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")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate 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;
  
  
  @Transient
  private String excel;
  
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class TranslatorId implements Serializable { 	
  private Integer translatorKey;
  
  private Integer versionNo;
}

public Date getInt(String string) {
	return null;
}

public Date getString(String string) {
	return null;
}

@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 + ", trEdu=" + trEdu + ", trCft=" + trCft + ", trVisa=" + trVisa
			+ ", aptDt=" + aptDt + ", dmlYn=" + dmlYn + ", remark=" + remark + ", wrtNm=" + wrtNm + ", wrtDt=" + wrtDt
			+ ", wrtOrgan=" + wrtOrgan + ", excel=" + excel + "]";
}




}
