source: Git/src/main/java/com/wediscussmovies/project/model/Person.java@ 6e7b472

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

Initial commit, barebones setup

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