summaryrefslogtreecommitdiff
path: root/src/main/scala/eu/mulk/entity/UserSettingPK.java
blob: 64168c86d23670314a7f5ac86d179eb4eb7de08d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package eu.mulk.entity;

import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Id;

public class UserSettingPK implements Serializable {

  private int userId;
  private String setting;

  @Column(name = "user", nullable = false)
  @Id
  public int getUserId() {
    return userId;
  }

  public void setUserId(int userId) {
    this.userId = userId;
  }

  @Column(name = "setting", nullable = false, length = -1)
  @Id
  public String getSetting() {
    return setting;
  }

  public void setSetting(String setting) {
    this.setting = setting;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    UserSettingPK that = (UserSettingPK) o;
    return userId == that.userId &&
        Objects.equals(setting, that.setting);
  }

  @Override
  public int hashCode() {
    return Objects.hash(userId, setting);
  }
}