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.dao.technical.model.IEntity;
28  import net.sumaris.core.model.administration.programStrategy.Program;
29  import net.sumaris.core.model.referential.location.Location;
30  
31  import javax.persistence.*;
32  import java.util.Date;
33  
34  @Data
35  @FieldNameConstants
36  @Entity
37  @Table(name = "vessel_owner")
38  public class VesselOwner implements IEntity<Integer> {
39  
40      @Id
41      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "VESSEL_OWNER_SEQ")
42      @SequenceGenerator(name = "VESSEL_OWNER_SEQ", sequenceName="VESSEL_OWNER_SEQ")
43      private Integer id;
44  
45      @Column(name = "registration_code", length = 40)
46      private String registrationCode;
47  
48      @Column(name = "last_name", length = 100)
49      private String lastName;
50  
51      @Column(name = "first_name", length = 100)
52      private String firstName;
53  
54      @Column(name = "street")
55      private String street;
56  
57      @Column(name = "zip_code")
58      private String zipCode;
59  
60      @Column(name = "city")
61      private String city;
62  
63      @Column(name = "date_of_birth")
64      private Date dateOfBirth;
65  
66      @Column(name = "retirement_date")
67      private Date retirementDate;
68  
69      @Column(name = "activity_start_date")
70      private Date activityStartDate;
71  
72      @Column(name = "phone_number", length = 50)
73      private String phoneNumber;
74  
75      @Column(name = "mobile_number", length = 50)
76      private String mobileNumber;
77  
78      @Column(name = "fax_number", length = 50)
79      private String faxNumber;
80  
81      @Column(name = "email")
82      private String email;
83  
84      @Column(name = "update_date")
85      @Temporal(TemporalType.TIMESTAMP)
86      private Date updateDate;
87  
88      @ManyToOne(fetch = FetchType.LAZY)
89      @JoinColumn(name = "country_location_fk")
90      private Location countryLocation;
91  
92      @ManyToOne(fetch = FetchType.LAZY)
93      @JoinColumn(name = "program_fk", nullable = false)
94      private Program program;
95  
96  }