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.administration.user.Department;
28 import net.sumaris.core.model.referential.QualityFlag;
29 import net.sumaris.core.model.referential.pmfm.Pmfm;
30 import net.sumaris.core.model.referential.pmfm.QualitativeValue;
31
32 import javax.persistence.*;
33 import java.util.Date;
34
35 @Data
36 @FieldNameConstants
37 @Entity
38 @Table(name="quantification_measurement_p")
39 public class ProductQuantificationMeasurement implements IMeasurementEntity {
40
41 @Id
42 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "QUANTIF_MEASUREMENT_P_SEQ")
43 @SequenceGenerator(name = "QUANTIF_MEASUREMENT_P_SEQ", sequenceName="QUANTIF_MEASUREMENT_P_SEQ")
44 private Integer id;
45
46 @Column(name = "update_date")
47 @Temporal(TemporalType.TIMESTAMP)
48 private Date updateDate;
49
50 @ManyToOne(fetch = FetchType.LAZY)
51 @JoinColumn(name = "recorder_department_fk", nullable = false)
52 private Department recorderDepartment;
53
54 @Column(length = LENGTH_COMMENTS)
55 private String comments;
56
57 @Column(name="control_date")
58 @Temporal(TemporalType.TIMESTAMP)
59 private Date controlDate;
60
61 @Column(name="qualification_date")
62 @Temporal(TemporalType.TIMESTAMP)
63 private Date qualificationDate;
64
65 @Column(name="qualification_comments", length = LENGTH_COMMENTS)
66 private String qualificationComments;
67
68 @ManyToOne(fetch = FetchType.LAZY, targetEntity = QualityFlag.class)
69 @JoinColumn(name = "quality_flag_fk", nullable = false)
70 private QualityFlag qualityFlag;
71
72 @Column(name = "numerical_value")
73 private Double numericalValue;
74
75 @Column(name = "alphanumerical_value", length = 40)
76 private String alphanumericalValue;
77
78 @Column(name = "digit_count")
79 private Integer digitCount;
80
81 @Column(name = "precision_value")
82 private Double precisionValue;
83
84 @ManyToOne(fetch = FetchType.EAGER, targetEntity = QualitativeValue.class)
85 @JoinColumn(name = "qualitative_value_fk")
86 private QualitativeValue qualitativeValue;
87
88 @Column(name = "rank_order")
89 private Integer rankOrder;
90
91 @Column(name = "is_reference_quantification", nullable = false)
92 private Boolean isReferenceQuantification;
93
94 @ManyToOne(fetch = FetchType.LAZY, targetEntity = Pmfm.class)
95 @JoinColumn(name = "pmfm_fk", nullable = false)
96 private Pmfm pmfm;
97
98 @ManyToOne(fetch = FetchType.LAZY, targetEntity = Product.class)
99 @JoinColumn(name = "product_fk")
100 private Product product;
101 }