Changeset 7fafead in Git for src/main/java/com/wediscussmovies/project/model/Genre.java
- Timestamp:
- 01/16/22 20:22:55 (3 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/model/Genre.java
r2d57cad r7fafead 1 1 package com.wediscussmovies.project.model; 2 2 3 3 4 import javax.persistence.*; 4 5 import java.util.Collection; 6 import lombok.Data; 7 5 8 6 9 @Entity 7 10 @Table(name = "genres", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies") 11 @Data 8 12 public class Genre { 13 9 14 @GeneratedValue(strategy = GenerationType.IDENTITY) 10 15 @Id 11 16 @Column(name = "genre_id") 12 private int genreId;13 @Basic 17 private Long id; 18 14 19 @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; 20 21 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; 75 24 } 76 25 77 26 public Genre() { 78 27 } 28 79 29 }
Note:
See TracChangeset
for help on using the changeset viewer.