diff options
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java | 18 | ||||
-rw-r--r-- | src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java | 19 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java index 2508f87..6472a8d 100644 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java +++ b/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java @@ -1,6 +1,7 @@ package eu.mulk.mulkcms2.entity; import java.io.Serializable; +import java.util.Objects; import javax.persistence.Column; import javax.persistence.Id; @@ -28,4 +29,21 @@ public class ArticleBranchTipPK implements Serializable { public void setRevisionId(int revisionId) { this.revisionId = revisionId; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof ArticleBranchTipPK)) { + return false; + } + ArticleBranchTipPK that = (ArticleBranchTipPK) o; + return articleId == that.articleId && revisionId == that.revisionId; + } + + @Override + public int hashCode() { + return Objects.hash(articleId, revisionId); + } } diff --git a/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java index 2da588e..edaaff1 100644 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java +++ b/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java @@ -1,6 +1,7 @@ package eu.mulk.mulkcms2.entity; import java.io.Serializable; +import java.util.Objects; import javax.persistence.Id; public class ArticleRevisionCharacteristicPK implements Serializable { @@ -24,4 +25,22 @@ public class ArticleRevisionCharacteristicPK implements Serializable { public void setArticleRevisionId(int articleRevisionId) { this.articleRevisionId = articleRevisionId; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof ArticleRevisionCharacteristicPK)) { + return false; + } + ArticleRevisionCharacteristicPK that = (ArticleRevisionCharacteristicPK) o; + return articleRevisionId == that.articleRevisionId + && Objects.equals(characteristic, that.characteristic); + } + + @Override + public int hashCode() { + return Objects.hash(characteristic, articleRevisionId); + } } |