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

import com.dbnt.sims.config.FileInfo;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "result_file")
@IdClass(ResultFile.ResultFileId.class)
public class ResultFile extends FileInfo {
  @Id
  @Column(name = "result_key")
  private Integer resultKey;
  @Id
  @Column(name = "file_seq")
  private Integer fileSeq;
  @Column(name = "file_type")
  private String fileType;
  @Column(name = "orig_nm")
  private String origNm;
  @Column(name = "conv_nm")
  private String convNm;
  @Column(name = "file_extn")
  private String fileExtn;
  @Column(name = "file_size")
  private String fileSize;
  @Column(name = "save_path")
  private String savePath;


  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class ResultFileId implements Serializable {
    private Integer resultKey;
    private Integer fileSeq;
  }

}
