1 package net.sumaris.core.model.technical.optimization.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.model.referential.taxon.ReferenceTaxon;
28 import net.sumaris.core.model.referential.taxon.TaxonGroup;
29
30 import javax.persistence.*;
31 import java.io.Serializable;
32 import java.util.Date;
33
34
35
36
37
38
39
40
41
42 @Data
43 @FieldNameConstants
44 @Entity
45 @Table(name = "taxon_group2taxon_hierarchy")
46 public class TaxonGroup2TaxonHierarchy implements Serializable {
47
48 @Id
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="is_inherited", nullable = false)
56 private Boolean isInherited;
57
58 @Id
59 @ManyToOne(fetch = FetchType.LAZY, targetEntity = TaxonGroup.class, cascade = CascadeType.DETACH)
60 @JoinColumn(name = "parent_taxon_group_fk", nullable = false)
61 private TaxonGroup parentTaxonGroup;
62
63 @Id
64 @ManyToOne(fetch = FetchType.LAZY, targetEntity = ReferenceTaxon.class, cascade = CascadeType.DETACH)
65 @JoinColumn(name = "child_reference_taxon_fk", nullable = false)
66 private ReferenceTaxon childReferenceTaxon;
67 }