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")
@IdClass(Violation.ViolationId.class)
public class Violation extends BaseModel {
  @Id
  @Column(name = "violation_key")
  private Integer violationKey;
  @Id
  @Column(name = "fb_key")
  private Integer fbKey;
  @Column(name = "violation")
  private String violation;

  @Transient
  private String violationEtc;

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