package com.dbnt.sims.fpiMgt.affairPlan.model;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "plan_apprv")
@IdClass(PlanApprv.PlanApprvId.class)
public class PlanApprv {
  @Id
  @Column(name = "plan_key")
  private Integer planKey;
  @Id
  @Column(name = "apprv_seq")
  private Integer apprvSeq;
  @Column(name = "state")
  private String state;
  @Column(name = "user_seq")
  private Integer userSeq;
  @Column(name = "user_nm")
  private String userNm;
  @Column(name = "etc")
  private String etc;
  @Column(name = "save_dt")
  private LocalDateTime saveDt;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class PlanApprvId implements Serializable {
    private Integer planKey;
    private Integer apprvSeq;
  }
}
