diff options
Diffstat (limited to 'src/main/scala/eu/mulk/entity/JournalEntryPK.java')
-rw-r--r-- | src/main/scala/eu/mulk/entity/JournalEntryPK.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main/scala/eu/mulk/entity/JournalEntryPK.java b/src/main/scala/eu/mulk/entity/JournalEntryPK.java new file mode 100644 index 0000000..189d94f --- /dev/null +++ b/src/main/scala/eu/mulk/entity/JournalEntryPK.java @@ -0,0 +1,50 @@ +package eu.mulk.entity; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class JournalEntryPK implements Serializable { + + private int journalId; + private int index; + + @Column(name = "journal", nullable = false) + @Id + public int getJournalId() { + return journalId; + } + + public void setJournalId(int journalId) { + this.journalId = journalId; + } + + @Column(name = "index", nullable = false) + @Id + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JournalEntryPK that = (JournalEntryPK) o; + return journalId == that.journalId && + index == that.index; + } + + @Override + public int hashCode() { + return Objects.hash(journalId, index); + } +} |