Ignore:
Timestamp:
01/16/22 20:22:55 (2 years ago)
Author:
Test <matonikolov77@…>
Branches:
main
Children:
3ded84d
Parents:
2d57cad (diff), 7bc8942 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolving models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/model/Genre.java

    r2d57cad r7fafead  
    11package com.wediscussmovies.project.model;
     2
    23
    34import javax.persistence.*;
    45import java.util.Collection;
     6import lombok.Data;
     7
    58
    69@Entity
    710@Table(name = "genres", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
     11@Data
    812public class Genre {
     13
    914    @GeneratedValue(strategy = GenerationType.IDENTITY)
    1015    @Id
    1116    @Column(name = "genre_id")
    12     private int genreId;
    13     @Basic
     17    private Long id;
     18
    1419    @Column(name = "genre_type")
    15     private String genreType;
    16     @OneToMany(mappedBy = "genresByGenreId")
    17     private Collection<MovieGenresEntity> movieGenresByGenreId;
    18     @OneToMany(mappedBy = "genresByGenreId")
    19     private Collection<UserGenresEntity> userGenresByGenreId;
     20    private String genre;
    2021
    21     public int getGenreId() {
    22         return genreId;
    23     }
    24 
    25     public void setGenreId(int genreId) {
    26         this.genreId = genreId;
    27     }
    28 
    29     public String getGenreType() {
    30         return genreType;
    31     }
    32 
    33     public void setGenreType(String genreType) {
    34         this.genreType = genreType;
    35     }
    36 
    37     @Override
    38     public boolean equals(Object o) {
    39         if (this == o) return true;
    40         if (o == null || getClass() != o.getClass()) return false;
    41 
    42         Genre that = (Genre) o;
    43 
    44         if (genreId != that.genreId) return false;
    45         if (genreType != null ? !genreType.equals(that.genreType) : that.genreType != null) return false;
    46 
    47         return true;
    48     }
    49 
    50     @Override
    51     public int hashCode() {
    52         int result = genreId;
    53         result = 31 * result + (genreType != null ? genreType.hashCode() : 0);
    54         return result;
    55     }
    56 
    57     public Collection<MovieGenresEntity> getMovieGenresByGenreId() {
    58         return movieGenresByGenreId;
    59     }
    60 
    61     public void setMovieGenresByGenreId(Collection<MovieGenresEntity> movieGenresByGenreId) {
    62         this.movieGenresByGenreId = movieGenresByGenreId;
    63     }
    64 
    65     public Collection<UserGenresEntity> getUserGenresByGenreId() {
    66         return userGenresByGenreId;
    67     }
    68 
    69     public void setUserGenresByGenreId(Collection<UserGenresEntity> userGenresByGenreId) {
    70         this.userGenresByGenreId = userGenresByGenreId;
    71     }
    72 
    73     public Genre(String genreType) {
    74         this.genreType = genreType;
     22    public Genre(String genre) {
     23        this.genre = genre;
    7524    }
    7625
    7726    public Genre() {
    7827    }
     28
    7929}
Note: See TracChangeset for help on using the changeset viewer.