1 package net.sumaris.core.model.data;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import lombok.Data;
26 import lombok.experimental.FieldNameConstants;
27 import net.sumaris.core.model.referential.QualityFlag;
28 import net.sumaris.core.model.referential.location.Location;
29
30 import javax.persistence.*;
31 import java.util.Date;
32
33 @Data
34 @FieldNameConstants
35 @Entity
36 @Table(name = "vessel_registration_period")
37 public class VesselRegistrationPeriod implements IWithVesselEntity<Integer, Vessel> {
38
39 @Id
40 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "VESSEL_REGISTRATION_PERIOD_SEQ")
41 @SequenceGenerator(name = "VESSEL_REGISTRATION_PERIOD_SEQ", sequenceName="VESSEL_REGISTRATION_PERIOD_SEQ")
42 private Integer id;
43
44 @Column(name = "start_date", nullable = false)
45 private Date startDate;
46
47 @Column(name = "end_date")
48 private Date endDate;
49
50 @Column(name = "registration_code", length = 40)
51 private String registrationCode;
52
53 @Column(name = "int_registration_code", length = 40)
54 private String intRegistrationCode;
55
56 @Column(name = "rank_order", nullable = false)
57 private Integer rankOrder;
58
59 @ManyToOne(fetch = FetchType.LAZY)
60 @JoinColumn(name = "vessel_fk", nullable = false)
61 private Vessel vessel;
62
63 @ManyToOne(fetch = FetchType.LAZY)
64 @JoinColumn(name = "registration_location_fk", nullable = false)
65 private Location registrationLocation;
66
67 @ManyToOne(fetch = FetchType.LAZY)
68 @JoinColumn(name = "quality_flag_fk", nullable = false)
69 private QualityFlag qualityFlag;
70
71 }