Matthias Andreas Benkard | 2f0b370 | 2020-01-12 15:46:34 +0100 | [diff] [blame^] | 1 | package eu.mulk.entity; |
| 2 | |
| 3 | import java.io.Serializable; |
| 4 | import java.util.Objects; |
| 5 | import javax.persistence.Column; |
| 6 | import javax.persistence.Id; |
| 7 | |
| 8 | public class PasswordPK implements Serializable { |
| 9 | |
| 10 | private int userId; |
| 11 | private String password; |
| 12 | |
| 13 | @Column(name = "user", nullable = false) |
| 14 | @Id |
| 15 | public int getUserId() { |
| 16 | return userId; |
| 17 | } |
| 18 | |
| 19 | public void setUserId(int userId) { |
| 20 | this.userId = userId; |
| 21 | } |
| 22 | |
| 23 | @Column(name = "password", nullable = false, length = -1) |
| 24 | @Id |
| 25 | public String getPassword() { |
| 26 | return password; |
| 27 | } |
| 28 | |
| 29 | public void setPassword(String password) { |
| 30 | this.password = password; |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public boolean equals(Object o) { |
| 35 | if (this == o) { |
| 36 | return true; |
| 37 | } |
| 38 | if (o == null || getClass() != o.getClass()) { |
| 39 | return false; |
| 40 | } |
| 41 | PasswordPK that = (PasswordPK) o; |
| 42 | return userId == that.userId && |
| 43 | Objects.equals(password, that.password); |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | public int hashCode() { |
| 48 | return Objects.hash(userId, password); |
| 49 | } |
| 50 | } |