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

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

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

@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "fishing_boat_version")
@IdClass(FishingBoatVersion.FishingBoatVersionId.class)
public class FishingBoatVersion extends FishingBoatBaseEntity {

  @Id
  @Column(name = "fb_key")
  private Integer fbKey;
  @Id
  @Column(name = "version_no")
  private Integer versionNo;

  @Transient
  private List<ViolationVersion> violationList;

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