package com.wediscussmovies.project.model; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.io.Serializable; public class PersonRatesEntityPK implements Serializable { @Column(name = "person_id") @Id private int personId; @Column(name = "user_id") @Id private int userId; public int getPersonId() { return personId; } public void setPersonId(int personId) { this.personId = personId; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PersonRatesEntityPK that = (PersonRatesEntityPK) o; if (personId != that.personId) return false; if (userId != that.userId) return false; return true; } @Override public int hashCode() { int result = personId; result = 31 * result + userId; return result; } }