blob: ae3df6643f822d77527b3ce2840e42f792063c98 [file] [log] [blame]
Matthias Andreas Benkard2f0b3702020-01-12 15:46:34 +01001package eu.mulk.entity;
2
3import java.io.Serializable;
4import java.util.Objects;
5import javax.persistence.Column;
6import javax.persistence.Id;
7
8public class UserPermissionPK implements Serializable {
9
10 private int userId;
11 private String permission;
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 = "permission", nullable = false, length = -1)
24 @Id
25 public String getPermission() {
26 return permission;
27 }
28
29 public void setPermission(String permission) {
30 this.permission = permission;
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 UserPermissionPK that = (UserPermissionPK) o;
42 return userId == that.userId &&
43 Objects.equals(permission, that.permission);
44 }
45
46 @Override
47 public int hashCode() {
48 return Objects.hash(userId, permission);
49 }
50}