Index: src/main/java/com/wediscussmovies/project/model/Discussion.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Discussion.java	(revision 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ src/main/java/com/wediscussmovies/project/model/Discussion.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -3,57 +3,187 @@
 import javax.persistence.*;
 import java.sql.Date;
-import java.util.List;
+import java.util.Collection;
+import java.util.Objects;
 
 @Entity
+@Table(name = "discussions", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
 public class Discussion {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
-    @GeneratedValue
-    private int discussion_id;
+    @Column(name = "discussion_id")
+    private int discussionId;
+    @Basic
+    @Column(name = "type")
+    private String type;
+    @Basic
+    @Column(name = "text")
+    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
-    @Column(name = "movie_id")
-    private Movie movie;
+    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
+    private User usersByUserId;
+    @ManyToOne
+    @JoinColumn(name = "movie_id", referencedColumnName = "movie_id",insertable = false, updatable = false)
+    private Movie moviesByMovieId;
+    @ManyToOne
+    @JoinColumn(name = "person_id", referencedColumnName = "person_id",insertable = false, updatable = false)
+    private Person personsByPersonId;
+    @OneToMany(mappedBy = "discussionsByDiscussionId")
+    private Collection<Reply> repliesByDiscussionId;
 
-    @ManyToOne()
-    @Column(name = "person_id")
-    private Person person;
+    public int getDiscussionId() {
+        return discussionId;
+    }
 
-    @ManyToOne
-    @Column(name = "user_id")
-    private User user;
+    public void setDiscussionId(int discussionId) {
+        this.discussionId = discussionId;
+    }
 
-    @Column(name = "text", length = 1000, nullable = false)
-    private String text;
+    public String getType() {
+        return type;
+    }
 
-    @Column(name = "title", length = 1000, nullable = false)
-    private String title;
+    public void setType(String type) {
+        this.type = type;
+    }
 
-    @Column(name = "date", nullable = false)
-    private Date date;
+    public String getText() {
+        return text;
+    }
 
-    @OneToMany
-    private List<Reply> replies;
+    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;
+    }
+
+    public Discussion() {
+    }
+
+    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;
+    }
 }
-
-
-/*
-    create table discussions(
-        discussion_id serial primary key,
-        type char(1) not null,
-        text varchar(1000) not null,
-        title varchar(250) not null,
-        date date not null,
-        user_id integer not null,
-        movie_id integer,
-        person_id integer,
-        constraint fk_user_created foreign key (user_id) references users(user_id)
-        on delete cascade on update cascade,
-        constraint ck_type_discussion check( (type = 'M' and movie_id notnull and person_id isnull)
-        or (type='P' and person_id  notnull and movie_id isnull)),
-        constraint fk_discussion_movie foreign key (movie_id) references movies(movie_id)
-        on delete cascade on update cascade,
-        constraint fk_discussion_person foreign key (person_id) references persons(person_id)
-        on delete cascade on update cascade
-    );
-
- */
Index: src/main/java/com/wediscussmovies/project/model/Genre.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Genre.java	(revision 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ src/main/java/com/wediscussmovies/project/model/Genre.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -1,26 +1,79 @@
 package com.wediscussmovies.project.model;
 
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
+import javax.persistence.*;
+import java.util.Collection;
 
-@Entity(name="genres")
+@Entity
+@Table(name = "genres", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
 public class Genre {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
-    @GeneratedValue
-    @Column(name="genre_id", nullable = false, unique = true)
-    private int genre_id;
+    @Column(name = "genre_id")
+    private int genreId;
+    @Basic
+    @Column(name = "genre_type")
+    private String genreType;
+    @OneToMany(mappedBy = "genresByGenreId")
+    private Collection<MovieGenresEntity> movieGenresByGenreId;
+    @OneToMany(mappedBy = "genresByGenreId")
+    private Collection<UserGenresEntity> userGenresByGenreId;
 
-    @Column(name="genre_type", length = 100, nullable = false, unique = true)
-    private String genre_type;
+    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() {
+    }
 }
-
-/*
-
-create table genres(
-    genre_id serial primary key,
-    genre_type varchar(100) not null unique
-);
-
- */
Index: src/main/java/com/wediscussmovies/project/model/Movie.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ src/main/java/com/wediscussmovies/project/model/Movie.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -3,53 +3,190 @@
 import javax.persistence.*;
 import java.sql.Date;
-import java.util.List;
+import java.util.Collection;
+import java.util.Objects;
 
-@Entity(name="movies")
+@Entity
+@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;
+    public int getMovieId() {
+        return movieId;
+    }
 
-    @Column(name="description", nullable = false, length = 1000)
-    private String description;
+    public void setMovieId(int movieId) {
+        this.movieId = movieId;
+    }
 
-    @Column(name="image_url", length = 300, nullable = false)
-    private String image_url;
+    public String getTitle() {
+        return title;
+    }
 
-    @Column(name="airing_date")
-    private Date airing_date;
+    public void setTitle(String title) {
+        this.title = title;
+    }
 
-    @Column(name="imdb_rating")
-    private float imdb_rating;
+    public String getDescription() {
+        return description;
+    }
 
-    @Column(name="director_id")
-    @ManyToOne
-    private Person director;
+    public void setDescription(String description) {
+        this.description = description;
+    }
 
-    @ManyToMany(mappedBy = "movie_actors")
-    private List<Person> actors;
+    public String getImageUrl() {
+        return imageUrl;
+    }
 
-    @ManyToMany(mappedBy = "movie_genres")
-    private List<Genre> genres;
+    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() {
+    }
+
+    @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')
-    );
- */
Index: src/main/java/com/wediscussmovies/project/model/MovieActorsEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieActorsEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/MovieActorsEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,74 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/MovieActorsEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,52 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/MovieGenresEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,73 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/MovieGenresEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,52 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/MovieLikesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,73 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/MovieLikesEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,52 @@
+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/MovieRatesEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/MovieRatesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/MovieRatesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,99 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/MovieRatesEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,52 @@
+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/Person.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/Person.java	(revision 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ src/main/java/com/wediscussmovies/project/model/Person.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -3,45 +3,156 @@
 import javax.persistence.*;
 import java.sql.Date;
-import java.util.List;
+import java.util.Collection;
 
-@Entity(name="persons")
+@Entity
+@Table(name = "persons", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
 public class Person {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
-    @GeneratedValue
-    private int person_id;
+    @Column(name = "person_id")
+    private int personId;
+    @Basic
+    @Column(name = "name")
+    private String name;
+    @Basic
+    @Column(name = "surname")
+    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")
+    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;
 
-    @Column(name="name", length=100, nullable=false, unique=false)
-    private String name;
+    public int getPersonId() {
+        return personId;
+    }
 
-    @Column(name="surname", length=100, nullable=false, unique=false)
-    private String surname;
+    public void setPersonId(int personId) {
+        this.personId = personId;
+    }
 
-    @Column(name="type", nullable = false)
-    private PersonType personType;
+    public String getName() {
+        return name;
+    }
 
-    @Column(name="date_of_birth", nullable=false)
-    private Date date_of_birth;
+    public void setName(String name) {
+        this.name = name;
+    }
 
-    @Column(name="image_url", length=300, nullable=false, unique=false)
-    private String image_url;
+    public String getSurname() {
+        return surname;
+    }
 
-    @Column(name="description", length=300, nullable=false, unique=false)
-    private String description;
+    public void setSurname(String surname) {
+        this.surname = surname;
+    }
 
-    @ManyToMany
-    private List<Movie> acts_in;
+    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.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;
+    }
 }
-
-
-/*
-        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')
-    );
- */
Index: src/main/java/com/wediscussmovies/project/model/PersonRatesEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/PersonRatesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/PersonRatesEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,99 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/PersonRatesEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,52 @@
+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/PersonType.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/PersonType.java	(revision 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ 	(revision )
@@ -1,5 +1,0 @@
-package com.wediscussmovies.project.model;
-
-public enum PersonType {
-    A, D
-}
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 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,53 @@
+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 RepliesEntityPK implements Serializable {
+    @Column(name = "discussion_id")
+    @Id
+    private int discussionId;
+    @Column(name = "reply_id")
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private int 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 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ src/main/java/com/wediscussmovies/project/model/Reply.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -4,42 +4,111 @@
 import java.sql.Date;
 
-@Entity(name="replies")
+@Entity
+@Table(name = "replies", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
+@IdClass(RepliesEntityPK.class)
 public class Reply {
     @Id
-    @GeneratedValue
+    @Column(name = "discussion_id",insertable = false, updatable = false)
+    private int discussionId;
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
     @Column(name = "reply_id")
-    private int reply_id;
+    private int replyId;
+    @Basic
+    @Column(name = "text")
+    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;
+    @ManyToOne
+    @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false,insertable = false, updatable = false)
+    private User usersByUserId;
 
-    @ManyToOne
-    @Column(name = "discussion_id")
-    private Discussion discussion;
+    public int getDiscussionId() {
+        return discussionId;
+    }
 
-    @ManyToOne
-    @Column(name = "user_id")
-    private User user;
+    public void setDiscussionId(int discussionId) {
+        this.discussionId = discussionId;
+    }
 
-    @Column(name = "date", nullable = false)
-    private Date date;
+    public int getReplyId() {
+        return replyId;
+    }
 
-    @Column(name= "text", length = 1000, nullable = false)
-    private String text;
+    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;
+    }
 }
-
-
-/*
-
-    create table replies(
-        discussion_id integer,
-        reply_id serial,
-        text varchar(1000) not null,
-        date date not null,
-        user_id integer not null,
-        constraint pk_replies primary key(discussion_id,reply_id),
-        constraint fk_user_create_reply foreign key (user_id) references users(user_id)
-        on delete cascade on update cascade,
-        constraint fk_reply_discussion foreign key (discussion_id) references discussions(discussion_id)
-        on delete cascade on update cascade
-
-
-    );
- */
Index: src/main/java/com/wediscussmovies/project/model/User.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/User.java	(revision 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ src/main/java/com/wediscussmovies/project/model/User.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -2,47 +2,163 @@
 
 import javax.persistence.*;
-import java.util.List;
+import java.util.Collection;
 
-@Entity(name="users")
+@Entity
+@Table(name = "users", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
 public class User {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Id
-    @GeneratedValue
-    @Column(name="user_id", nullable = false)
-    private int user_id;
+    @Column(name = "user_id")
+    private int userId;
+    @Basic
+    @Column(name = "username")
+    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;
 
-    @Column(name="username", length=50, nullable=false, unique=false)
-    private String username;
+    public int getUserId() {
+        return userId;
+    }
 
-    @Column(name="name", length=50, nullable=false, unique=false)
-    private String name;
+    public void setUserId(int userId) {
+        this.userId = userId;
+    }
 
-    @Column(name="surname", length=50, nullable=false, unique=false)
-    private String surname;
+    public String getUsername() {
+        return username;
+    }
 
-    @Column(name="email", length=50, nullable=false, unique=false)
-    private String email;
+    public void setUsername(String username) {
+        this.username = username;
+    }
 
-    @Column(name="password", length=100, nullable=false, unique=true)
-    private String password;
+    public String getName() {
+        return name;
+    }
 
-    //TODO("RATES_MOVIE")
-    @ManyToMany(mappedBy = "movie_likes")
-    private List<Movie> likes_movie;
+    public void setName(String name) {
+        this.name = name;
+    }
 
-    @ManyToMany(mappedBy = "user_genres")
-    private List<Genre> likes_genres;
+    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;
+    }
 }
-
-
-/*
-    create table users(
-      user_id serial primary key,
-      username varchar(50) not null unique,
-      name varchar(50) not null,
-      surname varchar(50) not null,
-      email varchar(100) not null unique,
-      password varchar(30) not null,
-      constraint ck_password check(length(password) >= 9)
-    );
- */
Index: src/main/java/com/wediscussmovies/project/model/UserGenresEntity.java
===================================================================
--- src/main/java/com/wediscussmovies/project/model/UserGenresEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/java/com/wediscussmovies/project/model/UserGenresEntity.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,73 @@
+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)
+++ src/main/java/com/wediscussmovies/project/model/UserGenresEntityPK.java	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,52 @@
+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/resources/application-prod.properties
===================================================================
--- src/main/resources/application-prod.properties	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
+++ src/main/resources/application-prod.properties	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -0,0 +1,12 @@
+spring.datasource.url=jdbc:postgresql://localhost:5432/db_202122z_va_prj_wediscussmovies
+spring.datasource.username=db_202122z_va_prj_wediscussmovies_owner
+spring.datasource.password=7d8fb26b5697
+
+## default connection pool
+
+spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQL95Dialect
+spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
+
+spring.jpa.hibernate.ddl-auto=validate
+spring.jpa.show-sql=true
+
Index: src/main/resources/application.properties
===================================================================
--- src/main/resources/application.properties	(revision 6e7b4721e1c9f389c67f55f48aab976c7eb4e7a9)
+++ src/main/resources/application.properties	(revision 2d57cad1a18953bc47becb4f96114a908ecbf03d)
@@ -1,1 +1,1 @@
-
+spring.profiles.active=prod
