1 package net.sumaris.core.model.referential.taxon;
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.dao.technical.model.IUpdateDateEntityBean;
28 import net.sumaris.core.model.referential.IItemReferentialEntity;
29
30 import javax.persistence.*;
31 import java.util.Date;
32
33
34
35
36
37
38 @Data
39 @FieldNameConstants
40 @Entity
41 @Table(name = "taxon_group_historical_record")
42 public class TaxonGroupHistoricalRecord implements IUpdateDateEntityBean<Integer, Date> {
43
44 @Id
45 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TAXON_GROUP_HISTORICAL_REC_SEQ")
46 @SequenceGenerator(name = "TAXON_GROUP_HISTORICAL_REC_SEQ", sequenceName="TAXON_GROUP_HISTORICAL_REC_SEQ")
47 private Integer id;
48
49 @Column(name = "start_date", nullable = false)
50 private Date startDate;
51
52 @Column(name = "end_date")
53 private Date endDate;
54
55 @Column(name = "update_date")
56 @Temporal(TemporalType.TIMESTAMP)
57 private Date updateDate;
58
59 @Column(length = IItemReferentialEntity.LENGTH_COMMENTS)
60 private String comments;
61
62 @ManyToOne(fetch = FetchType.LAZY, targetEntity = TaxonGroup.class)
63 @JoinColumn(name = "taxon_group_fk", nullable = false)
64 private TaxonGroup taxonGroup;
65
66 @ManyToOne(fetch = FetchType.LAZY, targetEntity = ReferenceTaxon.class)
67 @JoinColumn(name = "reference_taxon_fk", nullable = false)
68 private ReferenceTaxon referenceTaxon;
69 }