View Javadoc
1   package net.sumaris.core.model.data;
2   
3   /*-
4    * #%L
5    * SUMARiS:: Core
6    * %%
7    * Copyright (C) 2018 SUMARiS Consortium
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/gpl-3.0.html>.
22   * #L%
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.pmfm.Pmfm;
29  import net.sumaris.core.model.referential.pmfm.QualitativeValue;
30  import net.sumaris.core.model.referential.QualityFlag;
31  
32  import javax.persistence.*;
33  import java.util.Date;
34  
35  @Data
36  @FieldNameConstants
37  @Entity
38  @Table(name="vessel_use_measurement")
39  public class VesselUseMeasurement implements IMeasurementEntity {
40  
41      @Id
42      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "VESSEL_USE_MEASUREMENT_SEQ")
43      @SequenceGenerator(name = "VESSEL_USE_MEASUREMENT_SEQ", sequenceName="VESSEL_USE_MEASUREMENT_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 = 2000)
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      @ManyToOne(fetch = FetchType.LAZY, targetEntity = Pmfm.class)
92      @JoinColumn(name = "pmfm_fk", nullable = false)
93      private Pmfm pmfm;
94  
95      @ManyToOne(fetch = FetchType.LAZY, targetEntity = Trip.class)
96      @JoinColumn(name = "trip_fk")
97      private Trip trip;
98  
99      @ManyToOne(fetch = FetchType.LAZY, targetEntity = Operation.class)
100     @JoinColumn(name = "operation_fk")
101     private Operation operation;
102 }