source:
Git/src/main/java/com/wediscussmovies/project/model/Person.java@
7fafead
Last change on this file since 7fafead was 7fafead, checked in by , 2 years ago | |
---|---|
|
|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[6e7b472] | 1 | package com.wediscussmovies.project.model; |
2 | ||
[7fafead] | 3 | import com.wediscussmovies.project.model.enumerations.PersonType; |
[7a0bf79] | 4 | import lombok.Data; |
5 | ||
[6e7b472] | 6 | import javax.persistence.*; |
7 | import java.sql.Date; | |
[2d57cad] | 8 | import java.util.Collection; |
[6e7b472] | 9 | import java.util.List; |
10 | ||
[2d57cad] | 11 | @Entity |
12 | @Table(name = "persons", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies") | |
[7fafead] | 13 | @Data |
[6e7b472] | 14 | public class Person { |
[2d57cad] | 15 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
[6e7b472] | 16 | @Id |
[2d57cad] | 17 | @Column(name = "person_id") |
[7fafead] | 18 | private Long personId; |
[6e7b472] | 19 | |
20 | private String name; | |
21 | ||
22 | private String surname; | |
23 | ||
[7fafead] | 24 | @Enumerated |
25 | private PersonType type; | |
[6e7b472] | 26 | |
[2d57cad] | 27 | @Column(name = "date_of_birth") |
[7fafead] | 28 | private Date birthDate; |
[6e7b472] | 29 | |
[2d57cad] | 30 | @Column(name = "image_url") |
31 | private String imageUrl; | |
[6e7b472] | 32 | |
[2d57cad] | 33 | private String description; |
[6e7b472] | 34 | |
35 | ||
36 | ||
[2a5d6a3] | 37 | public Person() { |
[2d57cad] | 38 | } |
[6e7b472] | 39 | |
[7fafead] | 40 | public Person(String name, String surname, PersonType type, Date date_of_birth, String image_url, String description) { |
[2d57cad] | 41 | this.name = name; |
42 | this.surname = surname; | |
43 | this.type = type; | |
[7fafead] | 44 | this.birthDate = date_of_birth; |
45 | this.imageUrl = image_url; | |
[2d57cad] | 46 | this.description = description; |
47 | } | |
48 | } |
Note:
See TracBrowser
for help on using the repository browser.