package com.dbnt.faisp.main.fpiMgt.sri.model;

import com.dbnt.faisp.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 = "fa_sri_read_user")
@IdClass(SriReadUser.SriReadUserId.class)
public class SriReadUser extends FileInfo {
  @Id
  @Column(name = "fa_sri_key")
  private Integer faSriKey;
  @Id
  @Column(name = "user_seq")
  private Integer userSeq;
  @Column(name = "read_yn")
  private String readYn;
  @Column(name = "og_cd")
  private String ogCd;
  @Column(name = "ofc_cd")
  private String ofcCd;
  @Column(name = "title_cd")
  private String titleCd;
  @Column(name = "user_nm")
  private String userNm;
  
  @Override
public String toString() {
	return "SriReadUser [faSriKey=" + faSriKey + ", userSeq=" + userSeq + ", readYn=" + readYn + ", ogCd=" + ogCd
			+ ", ofcCd=" + ofcCd + ", titleCd=" + titleCd + ", userNm=" + userNm + "]";
}


@Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class SriReadUserId implements Serializable {
    private Integer faSriKey;
    private Integer userSeq;
  }

}
