Index: src/main/java/com/wediscussmovies/project/model/Discussion.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Discussion.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/Discussion.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -1,176 +1,61 @@
 package com.wediscussmovies.project.model;
+
+import com.wediscussmovies.project.model.enumerations.DiscussionType;
+import lombok.Data;
 
 import javax.persistence.*;
 import java.sql.Date;
 import java.util.Collection;
+import java.util.List;
 import java.util.Objects;
 
+@Data
 @Entity
 @Table(name = "discussions", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
 public class Discussion {
+
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
     @Column(name = "discussion_id")
-    private int discussionId;
-    @Basic
-    @Column(name = "type")
-    private String type;
-    @Basic
-    @Column(name = "text")
+    private Long id;
+
+    @Enumerated
+    private DiscussionType type;
+
     private String text;
-    @Basic
-    @Column(name = "title")
+
     private String title;
-    @Basic
-    @Column(name = "date")
+
     private Date date;
-    @Basic
-    @Column(name = "user_id")
-    private int userId;
-    @Basic
-    @Column(name = "movie_id")
-    private Integer movieId;
-    @Basic
-    @Column(name = "person_id")
-    private Integer personId;
+
+
+
+
 
     @ManyToOne
-    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
-    private User usersByUserId;
+    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false)
+    private User user;
+
     @ManyToOne
-    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id",insertable = false, updatable = false)
-    private Movie moviesByMovieId;
+    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id")
+    private Movie movie;
+
     @ManyToOne
-    @JoinColumn(name = "person_id", referencedColumnName = "person_id",insertable = false, updatable = false)
-    private Person personsByPersonId;
-    @OneToMany(mappedBy = "discussionsByDiscussionId")
-    private Collection<Reply> repliesByDiscussionId;
+    @JoinColumn(name = "person_id", referencedColumnName = "person_id")
+    private Person person;
 
-    public int getDiscussionId() {
-        return discussionId;
-    }
 
-    public void setDiscussionId(int discussionId) {
-        this.discussionId = discussionId;
-    }
 
-    public String getType() {
-        return type;
-    }
 
-    public void setType(String type) {
+
+
+    public Discussion(DiscussionType type, String text, String title, Date date, User user, Movie movie, Person person, List<Reply> replies) {
         this.type = type;
-    }
-
-    public String getText() {
-        return text;
-    }
-
-    public void setText(String text) {
         this.text = text;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
         this.title = title;
-    }
-
-    public Date getDate() {
-        return date;
-    }
-
-    public void setDate(Date date) {
         this.date = date;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    public Integer getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(Integer movieId) {
-        this.movieId = movieId;
-    }
-
-    public Integer getPersonId() {
-        return personId;
-    }
-
-    public void setPersonId(Integer personId) {
-        this.personId = personId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        Discussion that = (Discussion) o;
-
-        if (discussionId != that.discussionId) return false;
-        if (userId != that.userId) return false;
-        if (!Objects.equals(type, that.type)) return false;
-        if (!Objects.equals(text, that.text)) return false;
-        if (!Objects.equals(title, that.title)) return false;
-        if (!Objects.equals(date, that.date)) return false;
-        if (!Objects.equals(movieId, that.movieId)) return false;
-        if (!Objects.equals(personId, that.personId)) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = discussionId;
-        result = 31 * result + (type != null ? type.hashCode() : 0);
-        result = 31 * result + (text != null ? text.hashCode() : 0);
-        result = 31 * result + (title != null ? title.hashCode() : 0);
-        result = 31 * result + (date != null ? date.hashCode() : 0);
-        result = 31 * result + userId;
-        result = 31 * result + (movieId != null ? movieId.hashCode() : 0);
-        result = 31 * result + (personId != null ? personId.hashCode() : 0);
-        return result;
-    }
-
-    public User getUsersByUserId() {
-        return usersByUserId;
-    }
-
-    public void setUsersByUserId(User usersByUserId) {
-        this.usersByUserId = usersByUserId;
-    }
-
-    public Movie getMoviesByMovieId() {
-        return moviesByMovieId;
-    }
-
-    public void setMoviesByMovieId(Movie moviesByMovieId) {
-        this.moviesByMovieId = moviesByMovieId;
-    }
-
-    public Person getPersonsByPersonId() {
-        return personsByPersonId;
-    }
-
-    public void setPersonsByPersonId(Person personsByPersonId) {
-        this.personsByPersonId = personsByPersonId;
-    }
-
-    public Collection<Reply> getRepliesByDiscussionId() {
-        return repliesByDiscussionId;
-    }
-
-    public void setRepliesByDiscussionId(Collection<Reply> repliesByDiscussionId) {
-        this.repliesByDiscussionId = repliesByDiscussionId;
+        this.user = user;
+        this.movie = movie;
+        this.person = person;
     }
 
@@ -178,12 +63,4 @@
     }
 
-    public Discussion(String type, String text, String title, Date date, int userId, Integer movieId, Integer personId) {
-        this.type = type;
-        this.text = text;
-        this.title = title;
-        this.date = date;
-        this.userId = userId;
-        this.movieId = movieId;
-        this.personId = personId;
-    }
+
 }
Index: src/main/java/com/wediscussmovies/project/model/DiscussionType.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/DiscussionType.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/DiscussionType.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,5 @@
+package com.wediscussmovies.project.model;
+
+public enum DiscussionType {
+    M,P
+}
Index: src/main/java/com/wediscussmovies/project/model/Genre.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Genre.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/Genre.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -1,79 +1,29 @@
 package com.wediscussmovies.project.model;
+
 
 import javax.persistence.*;
 import java.util.Collection;
+import lombok.Data;
+
 
 @Entity
 @Table(name = "genres", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@Data
 public class Genre {
+
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
     @Column(name = "genre_id")
-    private int genreId;
-    @Basic
+    private Long id;
+
     @Column(name = "genre_type")
-    private String genreType;
-    @OneToMany(mappedBy = "genresByGenreId")
-    private Collection<MovieGenresEntity> movieGenresByGenreId;
-    @OneToMany(mappedBy = "genresByGenreId")
-    private Collection<UserGenresEntity> userGenresByGenreId;
+    private String genre;
 
-    public int getGenreId() {
-        return genreId;
-    }
-
-    public void setGenreId(int genreId) {
-        this.genreId = genreId;
-    }
-
-    public String getGenreType() {
-        return genreType;
-    }
-
-    public void setGenreType(String genreType) {
-        this.genreType = genreType;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        Genre that = (Genre) o;
-
-        if (genreId != that.genreId) return false;
-        if (genreType != null ? !genreType.equals(that.genreType) : that.genreType != null) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = genreId;
-        result = 31 * result + (genreType != null ? genreType.hashCode() : 0);
-        return result;
-    }
-
-    public Collection<MovieGenresEntity> getMovieGenresByGenreId() {
-        return movieGenresByGenreId;
-    }
-
-    public void setMovieGenresByGenreId(Collection<MovieGenresEntity> movieGenresByGenreId) {
-        this.movieGenresByGenreId = movieGenresByGenreId;
-    }
-
-    public Collection<UserGenresEntity> getUserGenresByGenreId() {
-        return userGenresByGenreId;
-    }
-
-    public void setUserGenresByGenreId(Collection<UserGenresEntity> userGenresByGenreId) {
-        this.userGenresByGenreId = userGenresByGenreId;
-    }
-
-    public Genre(String genreType) {
-        this.genreType = genreType;
+    public Genre(String genre) {
+        this.genre = genre;
     }
 
     public Genre() {
     }
+
 }
Index: src/main/java/com/wediscussmovies/project/model/Movie.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -1,129 +1,93 @@
 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;
 import java.util.Objects;
+
 
 @Entity
 @Table(name = "movies", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@Data
 public class Movie {
+
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
     @Column(name = "movie_id")
-    private int movieId;
-    @Basic
-    @Column(name = "title")
+    private Long id;
+
     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
+    private Date aringDate;
+
     @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;
+    private Double imbdRating;
+
+    @ManyToMany
+    private List<Genre> genres;
+
+    @ManyToMany
+    private List<Person> likes;
+
+    @ManyToMany
+    private List<Person> actors;
+
+
+
+
     @ManyToOne
-    @JoinColumn(name = "director_id", referencedColumnName = "person_id",insertable = false, updatable = false)
-    private Person personsByDirectorId;
+    @JoinColumn(name = "director_id")
+    private Person director;
 
-    public int getMovieId() {
-        return movieId;
+
+
+
+
+
+    public boolean isFromGenre(Genre genre){
+
+     return    genres
+                .stream()
+                .anyMatch(g -> Objects.equals(g.getId(), genre.getId()));
+
+    }
+    public boolean hasActor(Person p){
+        return
+                actors
+                        .stream()
+                        .anyMatch(a -> Objects.equals(a.getPersonId(), p.getPersonId()));
+
+
     }
 
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
+    public boolean isDirectedBy(Person p){
+        return Objects.equals(director.getPersonId(), p.getPersonId());
     }
 
-    public String getTitle() {
-        return title;
-    }
+    public static Comparator<Movie> comparatorTitle = Comparator.comparing(Movie::getTitle);
 
-    public void setTitle(String title) {
-        this.title = title;
-    }
 
-    public String getDescription() {
-        return description;
-    }
+    public Movie( String title, String description, String imageUrl, Date aringDate, Double imbdRating,Person director, List<Person> actors, List<Genre> genres) {
 
-    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;
+        this.aringDate = aringDate;
+        this.imbdRating = imbdRating;
+        this.genres = genres;
+        this.likes = likes;
+        this.actors = actors;
+        this.director = director;
     }
 
@@ -131,62 +95,4 @@
     }
 
-    @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;
-    }
 }
Index: src/main/java/com/wediscussmovies/project/model/MovieActorsEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieActorsEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,74 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "movie_actors", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
-@IdClass(MovieActorsEntityPK.class)
-public class MovieActorsEntity {
-    @Id
-    @Column(name = "movie_id")
-    private int movieId;
-    @Id
-    @Column(name = "actor_id")
-    private int actorId;
-
-    @ManyToOne
-    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id", nullable = false,insertable = false, updatable = false)
-    private Movie moviesByMovieId;
-    @ManyToOne
-    @JoinColumn(name = "actor_id", referencedColumnName = "person_id", nullable = false,insertable = false, updatable = false)
-    private Person personsByActorId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getActorId() {
-        return actorId;
-    }
-
-    public void setActorId(int actorId) {
-        this.actorId = actorId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieActorsEntity that = (MovieActorsEntity) o;
-
-        if (movieId != that.movieId) return false;
-        if (actorId != that.actorId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + actorId;
-        return result;
-    }
-
-    public Movie getMoviesByMovieId() {
-        return moviesByMovieId;
-    }
-
-    public void setMoviesByMovieId(Movie moviesByMovieId) {
-        this.moviesByMovieId = moviesByMovieId;
-    }
-
-    public Person getPersonsByActorId() {
-        return personsByActorId;
-    }
-
-    public void setPersonsByActorId(Person personsByActorId) {
-        this.personsByActorId = personsByActorId;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieActorsEntityPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieActorsEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class MovieActorsEntityPK implements Serializable {
-    @Column(name = "movie_id")
-    @Id
-    private int movieId;
-    @Column(name = "actor_id")
-    @Id
-    private int actorId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getActorId() {
-        return actorId;
-    }
-
-    public void setActorId(int actorId) {
-        this.actorId = actorId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieActorsEntityPK that = (MovieActorsEntityPK) o;
-
-        if (movieId != that.movieId) return false;
-        if (actorId != that.actorId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + actorId;
-        return result;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieGenresEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieGenresEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,73 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "movie_genres", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
-@IdClass(MovieGenresEntityPK.class)
-public class MovieGenresEntity {
-    @Id
-    @Column(name = "movie_id", insertable = false, updatable = false)
-    private int movieId;
-    @Id
-    @Column(name = "genre_id",insertable = false, updatable = false)
-    private int genreId;
-    @ManyToOne
-    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id", nullable = false,insertable = false, updatable = false)
-    private Movie moviesByMovieId;
-    @ManyToOne
-    @JoinColumn(name = "genre_id", referencedColumnName = "genre_id", nullable = false,insertable = false, updatable = false)
-    private Genre genresByGenreId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getGenreId() {
-        return genreId;
-    }
-
-    public void setGenreId(int genreId) {
-        this.genreId = genreId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieGenresEntity that = (MovieGenresEntity) o;
-
-        if (movieId != that.movieId) return false;
-        if (genreId != that.genreId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + genreId;
-        return result;
-    }
-
-    public Movie getMoviesByMovieId() {
-        return moviesByMovieId;
-    }
-
-    public void setMoviesByMovieId(Movie moviesByMovieId) {
-        this.moviesByMovieId = moviesByMovieId;
-    }
-
-    public Genre getGenresByGenreId() {
-        return genresByGenreId;
-    }
-
-    public void setGenresByGenreId(Genre genresByGenreId) {
-        this.genresByGenreId = genresByGenreId;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieGenresEntityPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieGenresEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class MovieGenresEntityPK implements Serializable {
-    @Column(name = "movie_id")
-    @Id
-    private int movieId;
-    @Column(name = "genre_id")
-    @Id
-    private int genreId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getGenreId() {
-        return genreId;
-    }
-
-    public void setGenreId(int genreId) {
-        this.genreId = genreId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieGenresEntityPK that = (MovieGenresEntityPK) o;
-
-        if (movieId != that.movieId) return false;
-        if (genreId != that.genreId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + genreId;
-        return result;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieLikesEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieLikesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,73 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "movie_likes", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
-@IdClass(MovieLikesEntityPK.class)
-public class MovieLikesEntity {
-    @Id
-    @Column(name = "movie_id")
-    private int movieId;
-    @Id
-    @Column(name = "user_id")
-    private int userId;
-    @ManyToOne
-    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id", nullable = false,insertable = false, updatable = false)
-    private Movie moviesByMovieId;
-    @ManyToOne
-    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
-    private User usersByUserId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieLikesEntity that = (MovieLikesEntity) o;
-
-        if (movieId != that.movieId) return false;
-        if (userId != that.userId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + userId;
-        return result;
-    }
-
-    public Movie getMoviesByMovieId() {
-        return moviesByMovieId;
-    }
-
-    public void setMoviesByMovieId(Movie moviesByMovieId) {
-        this.moviesByMovieId = moviesByMovieId;
-    }
-
-    public User getUsersByUserId() {
-        return usersByUserId;
-    }
-
-    public void setUsersByUserId(User usersByUserId) {
-        this.usersByUserId = usersByUserId;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieLikesEntityPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieLikesEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class MovieLikesEntityPK implements Serializable {
-    @Column(name = "movie_id")
-    @Id
-    private int movieId;
-    @Column(name = "user_id")
-    @Id
-    private int userId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieLikesEntityPK that = (MovieLikesEntityPK) o;
-
-        if (movieId != that.movieId) return false;
-        if (userId != that.userId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + userId;
-        return result;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieRates.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieRates.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/MovieRates.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,40 @@
+package com.wediscussmovies.project.model;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "movie_rates", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@IdClass(MovieRatesPK.class)
+public class MovieRates {
+
+    @Id
+    @Column(name = "movie_id")
+    private Long movieId;
+
+    @Id
+    @Column(name = "user_id")
+    private Long userId;
+
+    private String reason;
+
+    @Column(name = "stars_rated")
+    private int stars;
+
+    @ManyToOne
+    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id", nullable = false, insertable = false, updatable = false)
+    private Movie movie;
+
+    @ManyToOne
+    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false, insertable = false, updatable = false)
+    private User user;
+
+    public MovieRates(Long movieId, Long userId, String reason, int starsRated) {
+        this.movieId = movieId;
+        this.userId = userId;
+        this.reason = reason;
+        this.stars = starsRated;
+    }
+
+    public MovieRates() {
+    }
+}
Index: src/main/java/com/wediscussmovies/project/model/MovieRatesEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieRatesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,99 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "movie_rates", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
-@IdClass(MovieRatesEntityPK.class)
-public class MovieRatesEntity {
-    @Id
-    @Column(name = "movie_id")
-    private int movieId;
-    @Id
-    @Column(name = "user_id")
-    private int userId;
-    @Basic
-    @Column(name = "reason")
-    private String reason;
-    @Basic
-    @Column(name = "stars_rated")
-    private int starsRated;
-    @ManyToOne
-    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id", nullable = false,insertable = false, updatable = false)
-    private Movie moviesByMovieId;
-    @ManyToOne
-    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
-    private User usersByUserId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    public String getReason() {
-        return reason;
-    }
-
-    public void setReason(String reason) {
-        this.reason = reason;
-    }
-
-    public int getStarsRated() {
-        return starsRated;
-    }
-
-    public void setStarsRated(int starsRated) {
-        this.starsRated = starsRated;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieRatesEntity that = (MovieRatesEntity) o;
-
-        if (movieId != that.movieId) return false;
-        if (userId != that.userId) return false;
-        if (starsRated != that.starsRated) return false;
-        if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + userId;
-        result = 31 * result + (reason != null ? reason.hashCode() : 0);
-        result = 31 * result + starsRated;
-        return result;
-    }
-
-    public Movie getMoviesByMovieId() {
-        return moviesByMovieId;
-    }
-
-    public void setMoviesByMovieId(Movie moviesByMovieId) {
-        this.moviesByMovieId = moviesByMovieId;
-    }
-
-    public User getUsersByUserId() {
-        return usersByUserId;
-    }
-
-    public void setUsersByUserId(User usersByUserId) {
-        this.usersByUserId = usersByUserId;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieRatesEntityPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieRatesEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class MovieRatesEntityPK implements Serializable {
-    @Column(name = "movie_id")
-    @Id
-    private int movieId;
-    @Column(name = "user_id")
-    @Id
-    private int userId;
-
-    public int getMovieId() {
-        return movieId;
-    }
-
-    public void setMovieId(int movieId) {
-        this.movieId = movieId;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        MovieRatesEntityPK that = (MovieRatesEntityPK) o;
-
-        if (movieId != that.movieId) return false;
-        if (userId != that.userId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = movieId;
-        result = 31 * result + userId;
-        return result;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/MovieRatesPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieRatesPK.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/MovieRatesPK.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,17 @@
+package com.wediscussmovies.project.model;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class MovieRatesPK implements Serializable {
+
+    @Id
+    @Column(name = "movie_id")
+    private Long movieId;
+
+    @Id
+    @Column(name = "user_id")
+    private Long userId;
+
+}
Index: src/main/java/com/wediscussmovies/project/model/PasswordEncoder.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/PasswordEncoder.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/PasswordEncoder.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,36 @@
+package com.wediscussmovies.project.model;
+
+
+import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class PasswordEncoder {
+    public static byte[] getSHA(String input) throws NoSuchAlgorithmException
+    {
+        MessageDigest md = MessageDigest.getInstance("SHA-512");
+
+        return md.digest(input.getBytes(StandardCharsets.UTF_8));
+    }
+
+    public static String toHexString(byte[] hash)
+    {
+        BigInteger number = new BigInteger(1, hash);
+
+        StringBuilder hexString = new StringBuilder(number.toString(16));
+
+        while (hexString.length() < 32)
+        {
+            hexString.insert(0, '0');
+        }
+
+        return hexString.toString();
+    }
+
+    public static String getEncodedPasswordString(String password) throws NoSuchAlgorithmException {
+        return toHexString(getSHA(password));
+    }
+
+}
+
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 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -1,158 +1,48 @@
 package com.wediscussmovies.project.model;
+
+import com.wediscussmovies.project.model.enumerations.PersonType;
+import lombok.Data;
 
 import javax.persistence.*;
 import java.sql.Date;
 import java.util.Collection;
+import java.util.List;
 
 @Entity
 @Table(name = "persons", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@Data
 public class Person {
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
     @Column(name = "person_id")
-    private int personId;
-    @Basic
-    @Column(name = "name")
+    private Long personId;
+
     private String name;
-    @Basic
-    @Column(name = "surname")
+
     private String surname;
-    @Basic
-    @Column(name = "type")
-    private String type;
-    @Basic
+
+    @Enumerated
+    private PersonType type;
+
     @Column(name = "date_of_birth")
-    private Date dateOfBirth;
-    @Basic
+    private Date birthDate;
+
     @Column(name = "image_url")
     private String imageUrl;
-    @Basic
-    @Column(name = "description")
+
     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;
+
+
+    public Person() {
     }
 
-    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 type, 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.birthDate = date_of_birth;
+        this.imageUrl = 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;
-    }
-
-    @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 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;
-    }
 }
Index: src/main/java/com/wediscussmovies/project/model/PersonRates.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/PersonRates.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/PersonRates.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,41 @@
+package com.wediscussmovies.project.model;
+
+import lombok.Data;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "person_rates", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@IdClass(PersonRatesPK.class)
+@Data
+public class PersonRates {
+    @Id
+    @Column(name = "person_id")
+    private Long personId;
+
+    @Id
+    @Column(name = "user_id")
+    private Long userId;
+
+    private String reason;
+
+    @Column(name = "stars_rated")
+    private int stars;
+
+    @ManyToOne
+    @JoinColumn(name = "person_id", referencedColumnName = "person_id", nullable = false,insertable = false, updatable = false)
+    private Person person;
+    @ManyToOne
+    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
+    private User user;
+
+    public PersonRates(Long person_id, Long user_id, String reason, int stars_rated) {
+        this.personId = person_id;
+        this.userId = user_id;
+        this.reason = reason;
+        this.stars = stars_rated;
+    }
+
+    public PersonRates() {
+    }
+}
Index: src/main/java/com/wediscussmovies/project/model/PersonRatesEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/PersonRatesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,99 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "person_rates", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
-@IdClass(PersonRatesEntityPK.class)
-public class PersonRatesEntity {
-    @Id
-    @Column(name = "person_id")
-    private int personId;
-    @Id
-    @Column(name = "user_id")
-    private int userId;
-    @Basic
-    @Column(name = "reason")
-    private String reason;
-    @Basic
-    @Column(name = "stars_rated")
-    private int starsRated;
-    @ManyToOne
-    @JoinColumn(name = "person_id", referencedColumnName = "person_id", nullable = false,insertable = false, updatable = false)
-    private Person personsByPersonId;
-    @ManyToOne
-    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
-    private User usersByUserId;
-
-    public int getPersonId() {
-        return personId;
-    }
-
-    public void setPersonId(int personId) {
-        this.personId = personId;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    public String getReason() {
-        return reason;
-    }
-
-    public void setReason(String reason) {
-        this.reason = reason;
-    }
-
-    public int getStarsRated() {
-        return starsRated;
-    }
-
-    public void setStarsRated(int starsRated) {
-        this.starsRated = starsRated;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        PersonRatesEntity that = (PersonRatesEntity) o;
-
-        if (personId != that.personId) return false;
-        if (userId != that.userId) return false;
-        if (starsRated != that.starsRated) return false;
-        if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = personId;
-        result = 31 * result + userId;
-        result = 31 * result + (reason != null ? reason.hashCode() : 0);
-        result = 31 * result + starsRated;
-        return result;
-    }
-
-    public Person getPersonsByPersonId() {
-        return personsByPersonId;
-    }
-
-    public void setPersonsByPersonId(Person personsByPersonId) {
-        this.personsByPersonId = personsByPersonId;
-    }
-
-    public User getUsersByUserId() {
-        return usersByUserId;
-    }
-
-    public void setUsersByUserId(User usersByUserId) {
-        this.usersByUserId = usersByUserId;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/PersonRatesEntityPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/PersonRatesEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class PersonRatesEntityPK implements Serializable {
-    @Column(name = "person_id")
-    @Id
-    private int personId;
-    @Column(name = "user_id")
-    @Id
-    private int userId;
-
-    public int getPersonId() {
-        return personId;
-    }
-
-    public void setPersonId(int personId) {
-        this.personId = personId;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        PersonRatesEntityPK that = (PersonRatesEntityPK) o;
-
-        if (personId != that.personId) return false;
-        if (userId != that.userId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = personId;
-        result = 31 * result + userId;
-        return result;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/PersonRatesPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/PersonRatesPK.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/PersonRatesPK.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,17 @@
+package com.wediscussmovies.project.model;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class PersonRatesPK implements Serializable {
+
+    @Id
+    @Column(name = "person_id")
+    private Long personId;
+    @Id
+    @Column(name = "user_id")
+    private Long userId;
+
+
+}
Index: src/main/java/com/wediscussmovies/project/model/RepliesEntityPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/RepliesEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/RepliesEntityPK.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -8,46 +8,13 @@
 
 public class RepliesEntityPK implements Serializable {
+    @Id
     @Column(name = "discussion_id")
-    @Id
-    private int discussionId;
-    @Column(name = "reply_id")
+    private Long discussionId;
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private int replyId;
+    @Column(name = "reply_id")
+    private Long replyId;
 
-    public int getDiscussionId() {
-        return discussionId;
-    }
 
-    public void setDiscussionId(int discussionId) {
-        this.discussionId = discussionId;
-    }
 
-    public int getReplyId() {
-        return replyId;
-    }
-
-    public void setReplyId(int replyId) {
-        this.replyId = replyId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        RepliesEntityPK that = (RepliesEntityPK) o;
-
-        if (discussionId != that.discussionId) return false;
-        if (replyId != that.replyId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = discussionId;
-        result = 31 * result + replyId;
-        return result;
-    }
 }
Index: src/main/java/com/wediscussmovies/project/model/Reply.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Reply.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/Reply.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -1,114 +1,51 @@
 package com.wediscussmovies.project.model;
+
+import lombok.Data;
 
 import javax.persistence.*;
 import java.sql.Date;
+import java.util.Optional;
 
 @Entity
 @Table(name = "replies", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
 @IdClass(RepliesEntityPK.class)
+@Data
 public class Reply {
     @Id
-    @Column(name = "discussion_id",insertable = false, updatable = false)
-    private int discussionId;
+    @Column(name = "discussion_id")
+    private Long discussionId;
+
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
     @Column(name = "reply_id")
-    private int replyId;
-    @Basic
-    @Column(name = "text")
+    private Long replyId;
+
     private String text;
-    @Basic
-    @Column(name = "date")
+
     private Date date;
-    @Basic
-    @Column(name = "user_id")
-    private int userId;
+
     @ManyToOne
     @JoinColumn(name = "discussion_id", referencedColumnName = "discussion_id", nullable = false,insertable = false, updatable = false)
-    private Discussion discussionsByDiscussionId;
+    private Discussion discussion;
+
     @ManyToOne
-    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
-    private User usersByUserId;
+    @JoinColumn(name = "user_id")
+    private User user;
 
-    public int getDiscussionId() {
-        return discussionId;
+
+
+
+    public Reply(Discussion discussion, User user, Date date, String text) {
+        this.discussion = discussion;
+        this.user = user;
+        this.date = date;
+        this.text = text;
+
     }
 
-    public void setDiscussionId(int discussionId) {
-        this.discussionId = discussionId;
+    public Reply() {
+
     }
 
-    public int getReplyId() {
-        return replyId;
-    }
 
-    public void setReplyId(int replyId) {
-        this.replyId = replyId;
-    }
-
-    public String getText() {
-        return text;
-    }
-
-    public void setText(String text) {
-        this.text = text;
-    }
-
-    public Date getDate() {
-        return date;
-    }
-
-    public void setDate(Date date) {
-        this.date = date;
-    }
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        Reply that = (Reply) o;
-
-        if (discussionId != that.discussionId) return false;
-        if (replyId != that.replyId) return false;
-        if (userId != that.userId) return false;
-        if (text != null ? !text.equals(that.text) : that.text != null) return false;
-        if (date != null ? !date.equals(that.date) : that.date != null) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = discussionId;
-        result = 31 * result + replyId;
-        result = 31 * result + (text != null ? text.hashCode() : 0);
-        result = 31 * result + (date != null ? date.hashCode() : 0);
-        result = 31 * result + userId;
-        return result;
-    }
-
-    public Discussion getDiscussionsByDiscussionId() {
-        return discussionsByDiscussionId;
-    }
-
-    public void setDiscussionsByDiscussionId(Discussion discussionsByDiscussionId) {
-        this.discussionsByDiscussionId = discussionsByDiscussionId;
-    }
-
-    public User getUsersByUserId() {
-        return usersByUserId;
-    }
-
-    public void setUsersByUserId(User usersByUserId) {
-        this.usersByUserId = usersByUserId;
-    }
 }
Index: src/main/java/com/wediscussmovies/project/model/User.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/User.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/User.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -3,4 +3,5 @@
 import javax.persistence.*;
 import java.util.Collection;
+import java.util.List;
 
 @Entity
@@ -10,155 +11,31 @@
     @Id
     @Column(name = "user_id")
-    private int userId;
-    @Basic
-    @Column(name = "username")
+    private Long userId;
+
     private String username;
-    @Basic
-    @Column(name = "name")
+
     private String name;
-    @Basic
-    @Column(name = "surname")
+
     private String surname;
-    @Basic
-    @Column(name = "email")
+
     private String email;
-    @Basic
-    @Column(name = "password")
+
     private String password;
-    @OneToMany(mappedBy = "usersByUserId")
-    private Collection<Discussion> discussionsByUserId;
-    @OneToMany(mappedBy = "usersByUserId")
-    private Collection<MovieLikesEntity> movieLikesByUserId;
-    @OneToMany(mappedBy = "usersByUserId")
-    private Collection<MovieRatesEntity> movieRatesByUserId;
-    @OneToMany(mappedBy = "usersByUserId")
-    private Collection<PersonRatesEntity> personRatesByUserId;
-    @OneToMany(mappedBy = "usersByUserId")
-    private Collection<Reply> repliesByUserId;
-    @OneToMany(mappedBy = "usersByUserId")
-    private Collection<UserGenresEntity> userGenresByUserId;
 
-    public int getUserId() {
-        return userId;
-    }
+    @ManyToMany
+    private List<Movie> movies;
 
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
 
-    public String getUsername() {
-        return username;
-    }
 
-    public void setUsername(String username) {
+
+    public User(String username, String name, String surname, String email, String password) {
         this.username = username;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
         this.name = name;
-    }
-
-    public String getSurname() {
-        return surname;
-    }
-
-    public void setSurname(String surname) {
         this.surname = surname;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public void setEmail(String email) {
         this.email = email;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
         this.password = password;
     }
 
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        User that = (User) o;
-
-        if (userId != that.userId) return false;
-        if (username != null ? !username.equals(that.username) : that.username != null) 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 (email != null ? !email.equals(that.email) : that.email != null) return false;
-        if (password != null ? !password.equals(that.password) : that.password != null) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = userId;
-        result = 31 * result + (username != null ? username.hashCode() : 0);
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (surname != null ? surname.hashCode() : 0);
-        result = 31 * result + (email != null ? email.hashCode() : 0);
-        result = 31 * result + (password != null ? password.hashCode() : 0);
-        return result;
-    }
-
-    public Collection<Discussion> getDiscussionsByUserId() {
-        return discussionsByUserId;
-    }
-
-    public void setDiscussionsByUserId(Collection<Discussion> discussionsByUserId) {
-        this.discussionsByUserId = discussionsByUserId;
-    }
-
-    public Collection<MovieLikesEntity> getMovieLikesByUserId() {
-        return movieLikesByUserId;
-    }
-
-    public void setMovieLikesByUserId(Collection<MovieLikesEntity> movieLikesByUserId) {
-        this.movieLikesByUserId = movieLikesByUserId;
-    }
-
-    public Collection<MovieRatesEntity> getMovieRatesByUserId() {
-        return movieRatesByUserId;
-    }
-
-    public void setMovieRatesByUserId(Collection<MovieRatesEntity> movieRatesByUserId) {
-        this.movieRatesByUserId = movieRatesByUserId;
-    }
-
-    public Collection<PersonRatesEntity> getPersonRatesByUserId() {
-        return personRatesByUserId;
-    }
-
-    public void setPersonRatesByUserId(Collection<PersonRatesEntity> personRatesByUserId) {
-        this.personRatesByUserId = personRatesByUserId;
-    }
-
-    public Collection<Reply> getRepliesByUserId() {
-        return repliesByUserId;
-    }
-
-    public void setRepliesByUserId(Collection<Reply> repliesByUserId) {
-        this.repliesByUserId = repliesByUserId;
-    }
-
-    public Collection<UserGenresEntity> getUserGenresByUserId() {
-        return userGenresByUserId;
-    }
-
-    public void setUserGenresByUserId(Collection<UserGenresEntity> userGenresByUserId) {
-        this.userGenresByUserId = userGenresByUserId;
+    public User() {
     }
 }
Index: src/main/java/com/wediscussmovies/project/model/UserGenresEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/UserGenresEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,73 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "user_genres", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
-@IdClass(UserGenresEntityPK.class)
-public class UserGenresEntity {
-    @Id
-    @Column(name = "user_id")
-    private int userId;
-    @Id
-    @Column(name = "genre_id")
-    private int genreId;
-    @ManyToOne
-    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
-    private User usersByUserId;
-    @ManyToOne
-    @JoinColumn(name = "genre_id", referencedColumnName = "genre_id", nullable = false,insertable = false, updatable = false)
-    private Genre genresByGenreId;
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    public int getGenreId() {
-        return genreId;
-    }
-
-    public void setGenreId(int genreId) {
-        this.genreId = genreId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        UserGenresEntity that = (UserGenresEntity) o;
-
-        if (userId != that.userId) return false;
-        if (genreId != that.genreId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = userId;
-        result = 31 * result + genreId;
-        return result;
-    }
-
-    public User getUsersByUserId() {
-        return usersByUserId;
-    }
-
-    public void setUsersByUserId(User usersByUserId) {
-        this.usersByUserId = usersByUserId;
-    }
-
-    public Genre getGenresByGenreId() {
-        return genresByGenreId;
-    }
-
-    public void setGenresByGenreId(Genre genresByGenreId) {
-        this.genresByGenreId = genresByGenreId;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/UserGenresEntityPK.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/UserGenresEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package com.wediscussmovies.project.model;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class UserGenresEntityPK implements Serializable {
-    @Column(name = "user_id")
-    @Id
-    private int userId;
-    @Column(name = "genre_id")
-    @Id
-    private int genreId;
-
-    public int getUserId() {
-        return userId;
-    }
-
-    public void setUserId(int userId) {
-        this.userId = userId;
-    }
-
-    public int getGenreId() {
-        return genreId;
-    }
-
-    public void setGenreId(int genreId) {
-        this.genreId = genreId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        UserGenresEntityPK that = (UserGenresEntityPK) o;
-
-        if (userId != that.userId) return false;
-        if (genreId != that.genreId) return false;
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = userId;
-        result = 31 * result + genreId;
-        return result;
-    }
-}
Index: src/main/java/com/wediscussmovies/project/model/enumerations/DiscussionType.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/enumerations/DiscussionType.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/enumerations/DiscussionType.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,5 @@
+package com.wediscussmovies.project.model.enumerations;
+
+public enum DiscussionType {
+    M,P
+}
Index: src/main/java/com/wediscussmovies/project/model/enumerations/PersonType.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/enumerations/PersonType.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/enumerations/PersonType.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,5 @@
+package com.wediscussmovies.project.model.enumerations;
+
+public enum PersonType {
+    A, D
+}
Index: src/main/java/com/wediscussmovies/project/model/exception/InvalidUserCredentialsException.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/exception/InvalidUserCredentialsException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/exception/InvalidUserCredentialsException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,7 @@
+package com.wediscussmovies.project.model.exception;
+
+public class InvalidUserCredentialsException extends RuntimeException{
+    public InvalidUserCredentialsException(String username) {
+        super("The user with the username {" + username +"} cannot be authenticated.");
+    }
+}
Index: src/main/java/com/wediscussmovies/project/model/exception/MovieIdNotFoundException.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/exception/MovieIdNotFoundException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/exception/MovieIdNotFoundException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,7 @@
+package com.wediscussmovies.project.model.exception;
+
+public class MovieIdNotFoundException extends RuntimeException{
+    public MovieIdNotFoundException(Integer id) {
+        super("Movie with id {"+id+"} was not found.");
+    }
+}
Index: src/main/java/com/wediscussmovies/project/model/exception/NotEnoughArgumentsException.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/exception/NotEnoughArgumentsException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/exception/NotEnoughArgumentsException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,4 @@
+package com.wediscussmovies.project.model.exception;
+
+public class NotEnoughArgumentsException {
+}
Index: src/main/java/com/wediscussmovies/project/model/exception/PasswordsDontMatchException.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/exception/PasswordsDontMatchException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/exception/PasswordsDontMatchException.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,7 @@
+package com.wediscussmovies.project.model.exception;
+
+public class PasswordsDontMatchException extends RuntimeException{
+    public PasswordsDontMatchException() {
+        super("The passwords you provided did not match.");
+    }
+}
Index: src/main/java/com/wediscussmovies/project/model/exception/UserWithEmailAlreadyExists.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/exception/UserWithEmailAlreadyExists.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/exception/UserWithEmailAlreadyExists.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,7 @@
+package com.wediscussmovies.project.model.exception;
+
+public class UserWithEmailAlreadyExists extends RuntimeException{
+    public UserWithEmailAlreadyExists(String email) {
+        super("User with the email {" + email +"} is already registered");
+    }
+}
Index: src/main/java/com/wediscussmovies/project/model/exception/UserWithUsernameAlreadyExists.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/exception/UserWithUsernameAlreadyExists.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
+++ src/main/java/com/wediscussmovies/project/model/exception/UserWithUsernameAlreadyExists.java	(revision 7fafeade7bf35835297971768f9dc93f768c1ff0)
@@ -0,0 +1,7 @@
+package com.wediscussmovies.project.model.exception;
+
+public class UserWithUsernameAlreadyExists extends RuntimeException{
+    public UserWithUsernameAlreadyExists(String username) {
+        super("User with the username " + username + " is already registered");
+    }
+}
