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;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "translator_career")
@IdClass(TranslatorCrr.TranslatorCrrId.class)
public class TranslatorCrr extends BaseModel implements Serializable{
  @Id
  @Column(name = "career_seq")
  private Integer careerSeq;
  @Id
  @Column(name = "translator_key")
  private Integer translatorKey;
  @Column(name = "his_gubun")
  private String hisGubun;
  @Column(name = "contents")
  private String contents;
  @Column(name = "tc_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate tcDt;
  @Column(name = "remark")
  private String remark;
  
  
@Override
public String toString() {
	return "TranslatorCrr [careerSeq=" + careerSeq + ", translatorKey=" + translatorKey + ", hisGubun=" + hisGubun
			+ ", contents=" + contents + ", tcDt=" + tcDt + ", remark=" + remark + "]";
}
  

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