blob: 43793bbb3df528a85f8135767d7a35e371be86de [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 CachedPagePK implements Serializable {
9
10 private String alias;
11 private int characteristicHash;
12
13 @Column(name = "alias", nullable = false, length = -1)
14 @Id
15 public String getAlias() {
16 return alias;
17 }
18
19 public void setAlias(String alias) {
20 this.alias = alias;
21 }
22
23 @Column(name = "characteristic_hash", nullable = false)
24 @Id
25 public int getCharacteristicHash() {
26 return characteristicHash;
27 }
28
29 public void setCharacteristicHash(int characteristicHash) {
30 this.characteristicHash = characteristicHash;
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 CachedPagePK that = (CachedPagePK) o;
42 return characteristicHash == that.characteristicHash &&
43 Objects.equals(alias, that.alias);
44 }
45
46 @Override
47 public int hashCode() {
48 return Objects.hash(alias, characteristicHash);
49 }
50}