source: Git/src/main/java/com/wediscussmovies/project/model/Person.java@ 7a0bf79

main
Last change on this file since 7a0bf79 was 7a0bf79, checked in by Petar Partaloski <ppartaloski@…>, 2 years ago

Early implementations, MovieController CRUD implementation included

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package com.wediscussmovies.project.model;
2
3import lombok.Data;
4
5import javax.persistence.*;
6import java.sql.Date;
7import java.util.List;
8
9@Data
10@Entity(name="persons")
11public class Person {
12 @Id
13 @GeneratedValue
14 private int person_id;
15
16 @Column(name="name", length=100, nullable=false, unique=false)
17 private String name;
18
19 @Column(name="surname", length=100, nullable=false, unique=false)
20 private String surname;
21
22 @Column(name="type", nullable = false)
23 private PersonType personType;
24
25 @Column(name="date_of_birth", nullable=false)
26 private Date date_of_birth;
27
28 @Column(name="image_url", length=300, nullable=false, unique=false)
29 private String image_url;
30
31 @Column(name="description", length=300, nullable=false, unique=false)
32 private String description;
33
34 @ManyToMany
35 private List<Movie> acts_in;
36}
37
38
39/*
40 create table persons(
41 person_id serial primary key,
42 name varchar(100) not null,
43 surname varchar(100) not null,
44 type char(1) not null,
45 date_of_birth date not null,
46 image_url varchar(300) not null,
47 description varchar(300) not null,
48 constraint ck_type check (type ='A' or type='D')
49 );
50 */
Note: See TracBrowser for help on using the repository browser.