View Javadoc
1   package net.sumaris.core.model.referential.taxon;
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.referential.IItemReferentialEntity;
28  import net.sumaris.core.model.referential.Status;
29  
30  import javax.persistence.*;
31  import java.util.Date;
32  
33  /**
34   * Type de groupe de taxon.
35   *
36   * On distingue plusieurs types de regroupements de taxons :<ul>
37   *   <li>les groupes descriptifs des taxons, et utilisés à l'extraction des données (groupes écologiques par exemple)</li>
38   *   <li>les groupes utilisés pour l'identification sur les navires de pêche ou dans les criées : espèce commerciale, ou espèce communes (nom vernaculaire)</li>
39   * </ul>
40   */
41  @Data
42  @FieldNameConstants
43  @Entity
44  @Table(name = "taxon_group_type")
45  public class TaxonGroupType implements IItemReferentialEntity {
46  
47      @Id
48      @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "TAXON_GROUP_TYPE_SEQ")
49      @SequenceGenerator(name = "TAXON_GROUP_TYPE_SEQ", sequenceName="TAXON_GROUP_TYPE_SEQ")
50      private Integer id;
51  
52      @ManyToOne(fetch = FetchType.LAZY)
53      @JoinColumn(name = "status_fk", nullable = false)
54      private Status status;
55  
56      @Column(name = "creation_date", nullable = false)
57      @Temporal(TemporalType.TIMESTAMP)
58      private Date creationDate;
59  
60      @Column(name = "update_date")
61      @Temporal(TemporalType.TIMESTAMP)
62      private Date updateDate;
63  
64      @Column(nullable = false, length = LENGTH_LABEL)
65      private String label;
66  
67      @Column(nullable = false, length = LENGTH_NAME)
68      private String name;
69  
70      private String description;
71  
72      @Column(length = LENGTH_COMMENTS)
73      private String comments;
74  }