main
Last change
on this file since 2d57cad was 2d57cad, checked in by Test <matonikolov77@…>, 2 years ago |
Initial model part
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2d57cad] | 1 | package com.wediscussmovies.project.model;
|
---|
| 2 |
|
---|
| 3 | import javax.persistence.Column;
|
---|
| 4 | import javax.persistence.GeneratedValue;
|
---|
| 5 | import javax.persistence.GenerationType;
|
---|
| 6 | import javax.persistence.Id;
|
---|
| 7 | import java.io.Serializable;
|
---|
| 8 |
|
---|
| 9 | public class MovieGenresEntityPK implements Serializable {
|
---|
| 10 | @Column(name = "movie_id")
|
---|
| 11 | @Id
|
---|
| 12 | private int movieId;
|
---|
| 13 | @Column(name = "genre_id")
|
---|
| 14 | @Id
|
---|
| 15 | private int genreId;
|
---|
| 16 |
|
---|
| 17 | public int getMovieId() {
|
---|
| 18 | return movieId;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | public void setMovieId(int movieId) {
|
---|
| 22 | this.movieId = movieId;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public int getGenreId() {
|
---|
| 26 | return genreId;
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | public void setGenreId(int genreId) {
|
---|
| 30 | this.genreId = genreId;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | @Override
|
---|
| 34 | public boolean equals(Object o) {
|
---|
| 35 | if (this == o) return true;
|
---|
| 36 | if (o == null || getClass() != o.getClass()) return false;
|
---|
| 37 |
|
---|
| 38 | MovieGenresEntityPK that = (MovieGenresEntityPK) o;
|
---|
| 39 |
|
---|
| 40 | if (movieId != that.movieId) return false;
|
---|
| 41 | if (genreId != that.genreId) return false;
|
---|
| 42 |
|
---|
| 43 | return true;
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | @Override
|
---|
| 47 | public int hashCode() {
|
---|
| 48 | int result = movieId;
|
---|
| 49 | result = 31 * result + genreId;
|
---|
| 50 | return result;
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.