Index: src/main/java/com/wediscussmovies/project/model/Person.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Person.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/Person.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
@@ -1,158 +1,66 @@
 package com.wediscussmovies.project.model;
+
+import lombok.Data;
 
 import javax.persistence.*;
 import java.sql.Date;
-import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
 
+@Data
 @Entity
-@Table(name = "persons", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@Table(name="persons")
 public class Person {
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
-    @Column(name = "person_id")
-    private int personId;
-    @Basic
-    @Column(name = "name")
+    @GeneratedValue
+    private int person_id;
+
+    @Column(name="name", length=100, nullable=false, unique=false)
     private String name;
-    @Basic
-    @Column(name = "surname")
+
+    @Column(name="surname", length=100, nullable=false, unique=false)
     private String surname;
-    @Basic
-    @Column(name = "type")
-    private String type;
-    @Basic
-    @Column(name = "date_of_birth")
-    private Date dateOfBirth;
-    @Basic
-    @Column(name = "image_url")
-    private String imageUrl;
-    @Basic
-    @Column(name = "description")
+
+    @Column(name="type", nullable = false)
+    private PersonType personType;
+
+    @Column(name="date_of_birth", nullable=false)
+    private Date date_of_birth;
+
+    @Column(name="image_url", length=300, nullable=false, unique=false)
+    private String image_url;
+
+    @Column(name="description", length=300, nullable=false, unique=false)
     private String description;
-    @OneToMany(mappedBy = "personsByPersonId")
-    private Collection<Discussion> discussionsByPersonId;
-    @OneToMany(mappedBy = "personsByActorId")
-    private Collection<MovieActorsEntity> movieActorsByPersonId;
-    @OneToMany(mappedBy = "personsByDirectorId")
-    private Collection<Movie> moviesByPersonId;
-    @OneToMany(mappedBy = "personsByPersonId")
-    private Collection<PersonRatesEntity> personRatesByPersonId;
 
-    public int getPersonId() {
-        return personId;
-    }
+    @ManyToMany
+    private List<Movie> acts_in;
 
-    public void setPersonId(int personId) {
-        this.personId = personId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
+    public Person(String name, String surname, PersonType personType, Date date_of_birth, String image_url, String description) {
         this.name = name;
-    }
-
-    public String getSurname() {
-        return surname;
-    }
-
-    public void setSurname(String surname) {
         this.surname = surname;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public Date getDateOfBirth() {
-        return dateOfBirth;
-    }
-
-    public void setDateOfBirth(Date dateOfBirth) {
-        this.dateOfBirth = dateOfBirth;
-    }
-
-    public String getImageUrl() {
-        return imageUrl;
-    }
-
-    public void setImageUrl(String imageUrl) {
-        this.imageUrl = imageUrl;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
+        this.personType = personType;
+        this.date_of_birth = date_of_birth;
+        this.image_url = image_url;
         this.description = description;
     }
 
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        Person that = (Person) o;
-
-        if (personId != that.personId) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-        if (surname != null ? !surname.equals(that.surname) : that.surname != null) return false;
-        if (type != null ? !type.equals(that.type) : that.type != null) return false;
-        if (dateOfBirth != null ? !dateOfBirth.equals(that.dateOfBirth) : that.dateOfBirth != null) return false;
-        if (imageUrl != null ? !imageUrl.equals(that.imageUrl) : that.imageUrl != null) return false;
-        if (description != null ? !description.equals(that.description) : that.description != null) return false;
-
-        return true;
+    public Person() {
     }
 
-    @Override
-    public int hashCode() {
-        int result = personId;
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (surname != null ? surname.hashCode() : 0);
-        result = 31 * result + (type != null ? type.hashCode() : 0);
-        result = 31 * result + (dateOfBirth != null ? dateOfBirth.hashCode() : 0);
-        result = 31 * result + (imageUrl != null ? imageUrl.hashCode() : 0);
-        result = 31 * result + (description != null ? description.hashCode() : 0);
-        return result;
-    }
+    public static Comparator<Person> personComparatorByNameSurname = Comparator.comparing(Person::getName).thenComparing(Person::getSurname);
+}
 
-    public Collection<Discussion> getDiscussionsByPersonId() {
-        return discussionsByPersonId;
-    }
 
-    public void setDiscussionsByPersonId(Collection<Discussion> discussionsByPersonId) {
-        this.discussionsByPersonId = discussionsByPersonId;
-    }
-
-    public Collection<MovieActorsEntity> getMovieActorsByPersonId() {
-        return movieActorsByPersonId;
-    }
-
-    public void setMovieActorsByPersonId(Collection<MovieActorsEntity> movieActorsByPersonId) {
-        this.movieActorsByPersonId = movieActorsByPersonId;
-    }
-
-    public Collection<Movie> getMoviesByPersonId() {
-        return moviesByPersonId;
-    }
-
-    public void setMoviesByPersonId(Collection<Movie> moviesByPersonId) {
-        this.moviesByPersonId = moviesByPersonId;
-    }
-
-    public Collection<PersonRatesEntity> getPersonRatesByPersonId() {
-        return personRatesByPersonId;
-    }
-
-    public void setPersonRatesByPersonId(Collection<PersonRatesEntity> personRatesByPersonId) {
-        this.personRatesByPersonId = personRatesByPersonId;
-    }
-}
+/*
+        create table persons(
+        person_id serial primary key,
+        name varchar(100) not null,
+        surname varchar(100) not null,
+        type char(1) not null,
+        date_of_birth date not null,
+        image_url varchar(300) not null,
+        description varchar(300) not null,
+        constraint ck_type check (type ='A' or type='D')
+    );
+ */
