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

import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoFile;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.CaptinPhotoVersion;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.crackdownStatus.CrackdownStatus;
import com.dbnt.faisp.main.faStatistics.crackdownsStatus.model.fishingBoat.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 = "sailor_version")
@IdClass(SailorVersion.SailorVersionId.class)
public class SailorVersion extends SailorBaseEntity {

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

    @Id
    @Column(name = "sailor_key")
    private Integer sailorKey;

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

    /*@Transient
    private CrackdownStatusVersion crackdownStatusVersion;
    @Transient
    private FishingBoatVersion fishingBoatVersion;*/

    @Transient
    private Integer cdsKey;
    @Transient
    private Integer fbKey;
    @Transient
    private CrackdownStatus crackdownStatus;
    @Transient
    private FishingBoat fishingBoat;

    @Transient
    private List<CaptinPhotoVersion> fileList;
}
