main
Last change
on this file since 3fe36de 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:
950 bytes
|
Rev | Line | |
---|
[5b447b0] | 1 | package com.wediscussmovies.project.querymodels;
|
---|
| 2 |
|
---|
| 3 | import lombok.Data;
|
---|
| 4 |
|
---|
[3c0f9a9] | 5 | import javax.persistence.Entity;
|
---|
| 6 | import javax.persistence.Table;
|
---|
| 7 | import java.util.Comparator;
|
---|
| 8 | import java.util.Objects;
|
---|
| 9 |
|
---|
[5b447b0] | 10 | @Data
|
---|
| 11 | public class GenreLikes {
|
---|
[3c0f9a9] | 12 | private Integer genreId;
|
---|
[5b447b0] | 13 | private String name;
|
---|
| 14 | private Long likes;
|
---|
| 15 |
|
---|
[3c0f9a9] | 16 | public static Comparator<GenreLikes> sorter = Comparator.comparing(GenreLikes::getLikes).thenComparing(GenreLikes::getName).reversed();
|
---|
| 17 |
|
---|
| 18 | public GenreLikes(Integer genreId, String name, Long likes) {
|
---|
| 19 | this.genreId = genreId;
|
---|
[5b447b0] | 20 | this.name = name;
|
---|
| 21 | this.likes = likes;
|
---|
[3c0f9a9] | 22 |
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | @Override
|
---|
| 26 | public boolean equals(Object o) {
|
---|
| 27 | if (this == o) return true;
|
---|
| 28 | if (o == null || getClass() != o.getClass()) return false;
|
---|
| 29 | GenreLikes that = (GenreLikes) o;
|
---|
| 30 | return Objects.equals(genreId, that.genreId);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | @Override
|
---|
| 34 | public int hashCode() {
|
---|
| 35 | return Objects.hash(genreId);
|
---|
[5b447b0] | 36 | }
|
---|
| 37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.