View Javadoc
1   package net.sumaris.core.model.technical.extraction.rdb;
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.dao.technical.model.IEntity;
28  import net.sumaris.core.dao.technical.schema.DatabaseTableEnum;
29  
30  import javax.persistence.*;
31  import java.io.Serializable;
32  
33  @Data
34  @FieldNameConstants
35  @Entity
36  @Table(name = "p01_rdb_trip")
37  public class ProductRdbTrip implements Serializable, IEntity<Integer> {
38  
39      public static final DatabaseTableEnum TABLE = DatabaseTableEnum.P01_RDB_TRIP;
40  
41      public static final String COLUMN_SAMPLING_TYPE = "sampling_type";
42      public static final String COLUMN_VESSEL_FLAG_COUNTRY = "vessel_flag_country";
43      public static final String COLUMN_LANDING_COUNTRY = "landing_country";
44      public static final String COLUMN_YEAR = "year";
45      public static final String COLUMN_PROJECT = "project";
46      public static final String COLUMN_TRIP_CODE = "trip_code";
47      public static final String COLUMN_VESSEL_LENGTH = "vessel_length";
48      public static final String COLUMN_VESSEL_POWER = "vessel_power";
49      public static final String COLUMN_VESSEL_SIZE = "vessel_size";
50      public static final String COLUMN_VESSEL_TYPE = "vessel_type";
51      public static final String COLUMN_HARBOUR = "harbour";
52      public static final String COLUMN_NUMBER_OF_SETS = "number_hauls";
53      public static final String COLUMN_DAYS_AT_SEA = "days_at_sea";
54      public static final String COLUMN_VESSEL_IDENTIFIER = "vessel_identifier";
55      public static final String COLUMN_SAMPLING_COUNTRY= "sampling_country";
56      public static final String COLUMN_SAMPLING_METHOD = "sampling_method";
57  
58      @Id
59      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "p01_rdb_trip_seq")
60      @SequenceGenerator(name = "p01_rdb_trip_seq", sequenceName="p01_rdb_trip_seq")
61      private Integer id;
62  
63      @Column(nullable = false, length = 2, name = COLUMN_SAMPLING_TYPE)
64      private String samplingType;
65  
66      @Column(nullable = false, length = 3, name = COLUMN_LANDING_COUNTRY)
67      private String landingCountry;
68  
69      @Column(nullable = false, length = 3, name = COLUMN_VESSEL_FLAG_COUNTRY)
70      private String vesselFlagCountry;
71  
72      @Column(nullable = false, scale = 4, name = COLUMN_YEAR)
73      private Integer year;
74  
75      @Column(nullable = false, name = COLUMN_PROJECT)
76      private String project;
77  
78      @Column(nullable = false, name = COLUMN_TRIP_CODE, length = 50)
79      private String tripCode;
80  
81      @Column(scale= 6, name = COLUMN_VESSEL_LENGTH)
82      private Integer vesselLength;
83  
84      @Column(scale = 6, name = COLUMN_VESSEL_POWER)
85      private Integer vesselPower;
86  
87      @Column(scale = 6, name = COLUMN_VESSEL_SIZE)
88      private Integer vesselSize;
89  
90      @Column(nullable = false, scale = 3, name = COLUMN_VESSEL_TYPE)
91      private Integer vesselType;
92  
93      @Column(name = COLUMN_HARBOUR, length = 50)
94      private String harbour;
95  
96      @Column(scale = 5, name = COLUMN_NUMBER_OF_SETS)
97      private Integer numberOfSets;
98  
99      @Column(scale = 5,name = COLUMN_DAYS_AT_SEA)
100     private Integer daysAtSea;
101 
102     @Column(name = COLUMN_VESSEL_IDENTIFIER)
103     private Integer vesselIdentifier;
104 
105     @Column(nullable = false, length = 3, name = COLUMN_SAMPLING_COUNTRY)
106     private String samplingCountry;
107 
108     @Column(length = 50, name = COLUMN_SAMPLING_METHOD) // nullable = false (removed for GBR)
109     private String samplingMethod;
110 
111 
112 }