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

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_to_affair")
@IdClass(ResultToAffair.ResultToAffairId.class)
public class ResultToAffair {
  @Id
  @Column(name = "result_key")
  private Integer resultKey;
  @Id
  @Column(name = "affair_key")
  private Integer affairKey;

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