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

import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.FishingBoat;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.Violation;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
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 = "process_result_version")
@IdClass(ProcessResultVersion.ProcessResultVersionId.class)
public class ProcessResultVersion extends ProcessResultBaseEntity {

    @Id
    @Column(name = "pr_key")
    private Integer prKey;

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

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

    @Transient
    private Integer cdsKey;
    @Transient
    private Integer fbKey;
    @Transient
    private CrackdownStatus crackdownStatus;
    @Transient
    private FishingBoat fishingBoat;
    @Transient
    private List<Violation> violationList;
}
