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_landing")
37  public class ProductRdbLandingStatistics implements Serializable, IEntity<Integer> {
38  
39      public static final DatabaseTableEnum TABLE = DatabaseTableEnum.P01_RDB_LANDING;
40  
41      public static final String COLUMN_VESSEL_FLAG_COUNTRY = ProductRdbTrip.COLUMN_VESSEL_FLAG_COUNTRY;
42      public static final String COLUMN_LANDING_COUNTRY = ProductRdbTrip.COLUMN_LANDING_COUNTRY;
43      public static final String COLUMN_YEAR = ProductRdbTrip.COLUMN_YEAR;
44      public static final String COLUMN_QUARTER = "quarter";
45      public static final String COLUMN_MONTH = "month";
46      public static final String COLUMN_AREA = ProductRdbStation.COLUMN_AREA;
47      public static final String COLUMN_STATISTICAL_RECTANGLE = ProductRdbStation.COLUMN_STATISTICAL_RECTANGLE;
48      public static final String COLUMN_SUB_POLYGON = ProductRdbStation.COLUMN_SUB_POLYGON;
49      public static final String COLUMN_SPECIES = "species";
50      public static final String COLUMN_LANDING_CATEGORY = ProductRdbSpeciesList.COLUMN_LANDING_CATEGORY;
51      public static final String COLUMN_COMMERCIAL_SIZE_CATEGORY_SCALE = ProductRdbSpeciesList.COLUMN_COMMERCIAL_SIZE_CATEGORY_SCALE;
52      public static final String COLUMN_COMMERCIAL_SIZE_CATEGORY = ProductRdbSpeciesList.COLUMN_COMMERCIAL_SIZE_CATEGORY;
53      public static final String COLUMN_NATIONAL_METIER = ProductRdbStation.COLUMN_NATIONAL_METIER;
54      public static final String COLUMN_EU_METIER_LEVEL5 = ProductRdbStation.COLUMN_EU_METIER_LEVEL5;
55      public static final String COLUMN_EU_METIER_LEVEL6 = ProductRdbStation.COLUMN_EU_METIER_LEVEL6;
56      public static final String COLUMN_HARBOUR = ProductRdbTrip.COLUMN_HARBOUR;
57      public static final String COLUMN_VESSEL_LENGTH_CATEGORY = "vessel_length_cat";
58      public static final String COLUMN_UNALLOCATED_CATCH_WEIGHT = "unallocated_catch_weight";
59      public static final String COLUMN_AREA_MISREPORTED_CATCH_WEIGHT = "area_misreported_catch_weight";
60      public static final String COLUMN_OFFICIAL_LANDINGS_WEIGHT = "official_landings_weight";
61      public static final String COLUMN_LANDINGS_MULTIPLIER = "landings_multiplier";
62      public static final String COLUMN_OFFICIAL_LANDINGS_VALUE = "official_landings_value";
63  
64      @Id
65      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "p01_rdb_landing_seq")
66      @SequenceGenerator(name = "p01_rdb_landing_seq", sequenceName="p01_rdb_landing_seq")
67      private Integer id;
68  
69      @Column(nullable = false, length = 3, name = COLUMN_LANDING_COUNTRY)
70      private String landingCountry;
71  
72      @Column(nullable = false, length = 3, name = COLUMN_VESSEL_FLAG_COUNTRY)
73      private String vesselFlagCountry;
74  
75      @Column(nullable = false, scale = 4, name = COLUMN_YEAR)
76      private Integer year;
77  
78      @Column(nullable = false, scale = 1, name = COLUMN_QUARTER)
79      private Integer quarter;
80  
81      @Column(scale = 2, name = COLUMN_MONTH)
82      private Integer month;
83  
84      @Column(nullable = false, length = 25, name = COLUMN_AREA)
85      private String area;
86  
87      @Column(length = 25, name = COLUMN_STATISTICAL_RECTANGLE)
88      private String statisticalRectangle;
89  
90      @Column(length = 25, name = COLUMN_SUB_POLYGON)
91      private String subPolygon;
92  
93      @Column(nullable = false, length = 25, name = COLUMN_SPECIES)
94      private String species;
95  
96      @Column(nullable = false, length = 25, name = COLUMN_LANDING_CATEGORY)
97      private String landingCategory;
98  
99      @Column(length = 25, name = COLUMN_COMMERCIAL_SIZE_CATEGORY_SCALE)
100     private String commercialCategoryScale;
101 
102     @Column(length = 25, name = COLUMN_COMMERCIAL_SIZE_CATEGORY)
103     private String commercialCategory;
104 
105     @Column(length = 25, name = COLUMN_NATIONAL_METIER)
106     private String nationalMetier;
107 
108     @Column(length = 25, name = COLUMN_EU_METIER_LEVEL5)
109     private String metierLevel5;
110 
111     @Column(nullable = false, length = 25, name = COLUMN_EU_METIER_LEVEL6)
112     private String metierLevel6;
113 
114     @Column(length = 25, name = COLUMN_HARBOUR)
115     private String harbour;
116 
117     @Column(length = 25, name = COLUMN_VESSEL_LENGTH_CATEGORY)
118     private String vesselLengthCategory;
119 
120     @Column(nullable = false, name = COLUMN_UNALLOCATED_CATCH_WEIGHT, scale = 12, precision = 2)
121     private Double unallocatedCatchWeight;
122 
123     @Column(nullable = false, name = COLUMN_AREA_MISREPORTED_CATCH_WEIGHT, scale = 12, precision = 2)
124     private Double misReportedCatchWeight;
125 
126     @Column(nullable = false, name = COLUMN_OFFICIAL_LANDINGS_WEIGHT, scale = 12, precision = 2)
127     private Double landingsWeight;
128 
129     @Column(name = COLUMN_LANDINGS_MULTIPLIER, scale = 4, precision = 3)
130     private Double landingsMultiplier;
131 
132     @Column(name = COLUMN_OFFICIAL_LANDINGS_VALUE, scale = 12, precision = 2)
133     private Double landingsValue;
134 
135 
136 }