класс избранное сущность
This commit is contained in:
parent
902ba9515a
commit
58581e731b
@ -0,0 +1,57 @@
|
|||||||
|
package com.example.backend.favorites.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import com.example.backend.core.model.BaseEntity;
|
||||||
|
import com.example.backend.movies.model.MovieEntity;
|
||||||
|
import com.example.backend.users.model.UserEntity;
|
||||||
|
|
||||||
|
public class FavoriteEntity extends BaseEntity {
|
||||||
|
|
||||||
|
private UserEntity user;
|
||||||
|
private MovieEntity movie;
|
||||||
|
|
||||||
|
public FavoriteEntity() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FavoriteEntity(Integer id, UserEntity user, MovieEntity movie) {
|
||||||
|
|
||||||
|
super(id);
|
||||||
|
this.user = user;
|
||||||
|
this.movie = movie;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserEntity getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(UserEntity user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MovieEntity getMovie() {
|
||||||
|
return movie;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMovie(MovieEntity movie) {
|
||||||
|
this.movie = movie;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id, user, movie);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null || getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
final FavoriteEntity other = (FavoriteEntity) obj;
|
||||||
|
return Objects.equals(other.getId(), id)
|
||||||
|
&& Objects.equals(other.getUser(), user)
|
||||||
|
&& Objects.equals(other.getMovie(), movie);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user