main
Last change
on this file since ad4243e was 3c0f9a9, checked in by Petar Partaloski <ppartaloski@…>, 2 years ago |
Added genre liking, fixed counter, improved paging, improved searches
|
-
Property mode
set to
100644
|
File size:
932 bytes
|
Rev | Line | |
---|
[3c0f9a9] | 1 | package com.wediscussmovies.project.model.primarykeys;
|
---|
| 2 |
|
---|
| 3 | import lombok.Data;
|
---|
| 4 |
|
---|
| 5 | import javax.persistence.Column;
|
---|
| 6 | import javax.persistence.Embeddable;
|
---|
| 7 | import java.io.Serializable;
|
---|
| 8 |
|
---|
| 9 | @Embeddable
|
---|
| 10 | @Data
|
---|
| 11 | public class GenreLikesPK implements Serializable {
|
---|
| 12 |
|
---|
| 13 | @Column(name = "genre_id")
|
---|
| 14 | private int genreId;
|
---|
| 15 |
|
---|
| 16 | @Column(name = "user_id")
|
---|
| 17 | private int userId;
|
---|
| 18 |
|
---|
| 19 | public GenreLikesPK() {
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public GenreLikesPK(int genreId, int userId) {
|
---|
| 23 | this.genreId = genreId;
|
---|
| 24 | this.userId = userId;
|
---|
| 25 | }
|
---|
| 26 |
|
---|
| 27 | @Override
|
---|
| 28 | public boolean equals(Object o) {
|
---|
| 29 | if (this == o) return true;
|
---|
| 30 | if (o == null || getClass() != o.getClass()) return false;
|
---|
| 31 |
|
---|
| 32 | GenreLikesPK that = (GenreLikesPK) o;
|
---|
| 33 |
|
---|
| 34 | return userId == that.userId && genreId == that.genreId;
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | @Override
|
---|
| 38 | public int hashCode() {
|
---|
| 39 | int result = genreId;
|
---|
| 40 | result = 31 * result + userId;
|
---|
| 41 | return result;
|
---|
| 42 | }
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.