Index: src/main/java/com/wediscussmovies/project/model/Movie.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 2a5d6a3d7e82fe6a72290f16b30ecfbbd8df2c98)
+++ src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -1,94 +1,192 @@
 package com.wediscussmovies.project.model;
-
-import lombok.Data;
 
 import javax.persistence.*;
 import java.sql.Date;
-import java.util.Comparator;
-import java.util.List;
-@Data
+import java.util.Collection;
+import java.util.Objects;
+
 @Entity
-@Table (name="movies")
+@Table(name = "movies", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
 public class Movie {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
-    @GeneratedValue
-    @Column(name="movie_id", nullable = false)
-    private int movie_id;
+    @Column(name = "movie_id")
+    private int movieId;
+    @Basic
+    @Column(name = "title")
+    private String title;
+    @Basic
+    @Column(name = "description")
+    private String description;
+    @Basic
+    @Column(name = "image_url")
+    private String imageUrl;
+    @Basic
+    @Column(name = "airing_date")
+    private Date airingDate;
+    @Basic
+    @Column(name = "imdb_rating")
+    private Double imdbRating;
+    @Basic
+    @Column(name = "director_id")
+    private Integer directorId;
+    @OneToMany(mappedBy = "moviesByMovieId")
+    private Collection<Discussion> discussionsByMovieId;
+    @OneToMany(mappedBy = "moviesByMovieId")
+    private Collection<MovieActorsEntity> movieActorsByMovieId;
+    @OneToMany(mappedBy = "moviesByMovieId")
+    private Collection<MovieGenresEntity> movieGenresByMovieId;
+    @OneToMany(mappedBy = "moviesByMovieId")
+    private Collection<MovieLikesEntity> movieLikesByMovieId;
+    @OneToMany(mappedBy = "moviesByMovieId")
+    private Collection<MovieRatesEntity> movieRatesByMovieId;
+    @ManyToOne
+    @JoinColumn(name = "director_id", referencedColumnName = "person_id",insertable = false, updatable = false)
+    private Person personsByDirectorId;
 
-    @Column(name="title", length = 150, unique = true, nullable = false)
-    private String Title;
-
-    @Column(name="description", nullable = false, length = 1000)
-    private String description;
-
-    @Column(name="image_url", length = 300, nullable = false)
-    private String image_url;
-
-    @Column(name="airing_date")
-    private Date airing_date;
-
-    @Column(name="imdb_rating")
-    private float imdb_rating;
-
-    @Column(name="director_id")
-    @ManyToOne
-    private Person director;
-
-    @ManyToMany(mappedBy = "movie_actors")
-    private List<Person> actors;
-
-    @ManyToMany(mappedBy = "movie_genres")
-    private List<Genre> genres;
-
-    public boolean isFromGenre(Genre genre){
-        for(Genre g: genres){
-            if(g.getGenre_id() == genre.getGenre_id())
-                return true;
-        }
-        return false;
-    }
-    public boolean hasActor(Person p){
-        for(Person person: actors){
-            if(person.getPerson_id() == p.getPerson_id())
-                return true;
-        }
-        return false;
+    public int getMovieId() {
+        return movieId;
     }
 
-    public boolean isDirectedBy(Person p){
-        return director.getPerson_id() == p.getPerson_id();
+    public void setMovieId(int movieId) {
+        this.movieId = movieId;
     }
 
-    public static Comparator<Movie> comparatorTitle = Comparator.comparing(Movie::getTitle);
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getImageUrl() {
+        return imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl) {
+        this.imageUrl = imageUrl;
+    }
+
+    public Date getAiringDate() {
+        return airingDate;
+    }
+
+    public void setAiringDate(Date airingDate) {
+        this.airingDate = airingDate;
+    }
+
+    public Double getImdbRating() {
+        return imdbRating;
+    }
+
+    public void setImdbRating(Double imdbRating) {
+        this.imdbRating = imdbRating;
+    }
+
+    public Integer getDirectorId() {
+        return directorId;
+    }
+
+    public void setDirectorId(Integer directorId) {
+        this.directorId = directorId;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Movie that = (Movie) o;
+
+        if (movieId != that.movieId) return false;
+        if (!Objects.equals(title, that.title)) return false;
+        if (!Objects.equals(description, that.description)) return false;
+        if (!Objects.equals(imageUrl, that.imageUrl)) return false;
+        if (!Objects.equals(airingDate, that.airingDate)) return false;
+        if (!Objects.equals(imdbRating, that.imdbRating)) return false;
+        if (!Objects.equals(directorId, that.directorId)) return false;
+
+        return true;
+    }
+
+    public Movie(String title, String description, String imageUrl, Date airingDate, Double imdbRating, Integer directorId) {
+        this.title = title;
+        this.description = description;
+        this.imageUrl = imageUrl;
+        this.airingDate = airingDate;
+        this.imdbRating = imdbRating;
+        this.directorId = directorId;
+    }
 
     public Movie() {
     }
 
-    public Movie(String title, String description, String image_url, Date airing_date, float imdb_rating, Person director, List<Person> actors, List<Genre> genres) {
-        Title = title;
-        this.description = description;
-        this.image_url = image_url;
-        this.airing_date = airing_date;
-        this.imdb_rating = imdb_rating;
-        this.director = director;
-        this.actors = actors;
-        this.genres = genres;
+    @Override
+    public int hashCode() {
+        int result = movieId;
+        result = 31 * result + (title != null ? title.hashCode() : 0);
+        result = 31 * result + (description != null ? description.hashCode() : 0);
+        result = 31 * result + (imageUrl != null ? imageUrl.hashCode() : 0);
+        result = 31 * result + (airingDate != null ? airingDate.hashCode() : 0);
+        result = 31 * result + (imdbRating != null ? imdbRating.hashCode() : 0);
+        result = 31 * result + (directorId != null ? directorId.hashCode() : 0);
+        return result;
+    }
+
+    public Collection<Discussion> getDiscussionsByMovieId() {
+        return discussionsByMovieId;
+    }
+
+    public void setDiscussionsByMovieId(Collection<Discussion> discussionsByMovieId) {
+        this.discussionsByMovieId = discussionsByMovieId;
+    }
+
+    public Collection<MovieActorsEntity> getMovieActorsByMovieId() {
+        return movieActorsByMovieId;
+    }
+
+    public void setMovieActorsByMovieId(Collection<MovieActorsEntity> movieActorsByMovieId) {
+        this.movieActorsByMovieId = movieActorsByMovieId;
+    }
+
+    public Collection<MovieGenresEntity> getMovieGenresByMovieId() {
+        return movieGenresByMovieId;
+    }
+
+    public void setMovieGenresByMovieId(Collection<MovieGenresEntity> movieGenresByMovieId) {
+        this.movieGenresByMovieId = movieGenresByMovieId;
+    }
+
+    public Collection<MovieLikesEntity> getMovieLikesByMovieId() {
+        return movieLikesByMovieId;
+    }
+
+    public void setMovieLikesByMovieId(Collection<MovieLikesEntity> movieLikesByMovieId) {
+        this.movieLikesByMovieId = movieLikesByMovieId;
+    }
+
+    public Collection<MovieRatesEntity> getMovieRatesByMovieId() {
+        return movieRatesByMovieId;
+    }
+
+    public void setMovieRatesByMovieId(Collection<MovieRatesEntity> movieRatesByMovieId) {
+        this.movieRatesByMovieId = movieRatesByMovieId;
+    }
+
+    public Person getPersonsByDirectorId() {
+        return personsByDirectorId;
+    }
+
+    public void setPersonsByDirectorId(Person personsByDirectorId) {
+        this.personsByDirectorId = personsByDirectorId;
     }
 }
-
-
-/*
-
-    create table movies(
-        movie_id serial primary key,
-        title varchar(150) not null unique,
-        description varchar(1000) not null,
-        image_url varchar(300) not null,
-        airing_date date not null,
-        imdb_rating float,
-        director_id integer,
-        constraint fk_movie_director foreign key (director_id) references persons(person_id)
-        on delete cascade on update cascade,
-        constraint ck_person_is_director check( check_constraint_person(director_id) = 'D')
-    );
- */
