blob: 189d94f58dad05efff00742869d18d6899c93c2d [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 JournalEntryPK implements Serializable {
9
10 private int journalId;
11 private int index;
12
13 @Column(name = "journal", nullable = false)
14 @Id
15 public int getJournalId() {
16 return journalId;
17 }
18
19 public void setJournalId(int journalId) {
20 this.journalId = journalId;
21 }
22
23 @Column(name = "index", nullable = false)
24 @Id
25 public int getIndex() {
26 return index;
27 }
28
29 public void setIndex(int index) {
30 this.index = index;
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 JournalEntryPK that = (JournalEntryPK) o;
42 return journalId == that.journalId &&
43 index == that.index;
44 }
45
46 @Override
47 public int hashCode() {
48 return Objects.hash(journalId, index);
49 }
50}