View Javadoc
1   /*
2    * #%L
3    * SUMARiS
4    * %%
5    * Copyright (C) 2019 SUMARiS Consortium
6    * %%
7    * This program is free software: you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as
9    * published by the Free Software Foundation, either version 3 of the
10   * License, or (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public
18   * License along with this program.  If not, see
19   * <http://www.gnu.org/licenses/gpl-3.0.html>.
20   * #L%
21   */
22  
23  package net.sumaris.core.model.technical.extraction;
24  
25  import lombok.Data;
26  import lombok.experimental.FieldNameConstants;
27  import net.sumaris.core.model.referential.IItemReferentialEntity;
28  import net.sumaris.core.model.referential.Status;
29  
30  import javax.persistence.*;
31  import java.util.Date;
32  
33  @Data
34  @FieldNameConstants
35  @Entity
36  @Cacheable
37  @Table(name = "extraction_product_strata")
38  public class ExtractionProductStrata implements IItemReferentialEntity {
39  
40      @Id
41      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EXTRACTION_PRODUCT_STRATA_SEQ")
42      @SequenceGenerator(name = "EXTRACTION_PRODUCT_STRATA_SEQ", sequenceName="EXTRACTION_PRODUCT_STRATA_SEQ")
43      private Integer id;
44  
45      @Column(nullable = false, length = IItemReferentialEntity.LENGTH_LABEL)
46      private String label;
47  
48      @Column(length = IItemReferentialEntity.LENGTH_NAME)
49      private String name;
50  
51      @ManyToOne(fetch = FetchType.LAZY)
52      @JoinColumn(name = "status_fk", nullable = false)
53      private Status status;
54  
55      @Column(name = "creation_date", nullable = false)
56      @Temporal(TemporalType.TIMESTAMP)
57      private Date creationDate;
58  
59      @Column(name = "update_date")
60      @Temporal(TemporalType.TIMESTAMP)
61      private Date updateDate;
62  
63      @Column(name = "is_default")
64      private Boolean isDefault;
65  
66      @ManyToOne(fetch = FetchType.LAZY)
67      @JoinColumn(name = "extraction_product_fk", nullable = false)
68      private ExtractionProduct product;
69  
70      @ManyToOne(fetch = FetchType.LAZY)
71      @JoinColumn(name = "extraction_table_fk")
72      private ExtractionProductTable table;
73  
74      @ManyToOne(fetch = FetchType.LAZY)
75      @JoinColumn(name = "time_extraction_column_fk")
76      private ExtractionProductColumn timeColumn;
77  
78      @ManyToOne(fetch = FetchType.LAZY)
79      @JoinColumn(name = "space_extraction_column_fk")
80      private ExtractionProductColumn spaceColumn;
81  
82      @ManyToOne(fetch = FetchType.LAZY)
83      @JoinColumn(name = "agg_extraction_column_fk")
84      private ExtractionProductColumn aggColumn;
85  
86      @ManyToOne(fetch = FetchType.LAZY)
87      @JoinColumn(name = "tech_extraction_column_fk")
88      private ExtractionProductColumn techColumn;
89  
90      @Column(name = "agg_function", length = 30)
91      private String aggFunction;
92  
93  }