package com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat;

import com.dbnt.faisp.config.BaseModel;
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 = "violation_version")
@IdClass(ViolationVersion.ViolationVersionId.class)
public class ViolationVersion extends BaseModel {
  @Id
  @Column(name = "violation_key")
  private Integer violationKey;
  @Id
  @Column(name = "fb_key")
  private Integer fbKey;
  @Id
  @Column(name = "version_no")
  private Integer versionNo;
  @Column(name = "violation")
  private String violation;

  @Embeddable
  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class ViolationVersionId implements Serializable{
    private Integer violationKey;
    private Integer fbKey;
    private Integer versionNo;
  }
}
