package com.dbnt.kcscbackend.admin.standardResearch.model;

import lombok.*;
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.LocalDateTime;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_research")
public class TnResearchLightweight {

  @Id
  @Column(name = "rs_seq")
  private Long rsSeq;

  @Column(name = "rs_title")
  private String rsTitle;

  @Column(name = "rs_start_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime rsStartDate;

  @Column(name = "rs_end_date")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime rsEndDate;

  @Column(name = "rs_director")
  private String rsDirector;

  @Column(name = "frst_crt_id")
  private String frstCrtId;

  @Column(name = "frst_crt_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime frstCrtDt;

  @Column(name = "last_chg_id")
  private String lastChgId;

  @Column(name = "last_chg_dt")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime lastChgDt;

  @Column(name = "use_yn")
  private String useYn;


  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class TnResearchId implements Serializable {

    private static final long serialVersionUID = 9042992093269088042L;

    private String rsSeq;
  }

}