Matthias Andreas Benkard | 2f0b370 | 2020-01-12 15:46:34 +0100 | [diff] [blame^] | 1 | package eu.mulk.entity; |
| 2 | |
| 3 | import io.quarkus.hibernate.orm.panache.PanacheEntityBase; |
| 4 | import java.util.Objects; |
| 5 | import javax.persistence.Basic; |
| 6 | import javax.persistence.Column; |
| 7 | import javax.persistence.Entity; |
| 8 | import javax.persistence.Id; |
| 9 | import javax.persistence.IdClass; |
| 10 | import javax.persistence.Table; |
| 11 | |
| 12 | @Entity |
| 13 | @Table(name = "article_branch_tips", schema = "public", catalog = "mulkcms") |
| 14 | @IdClass(ArticleBranchTipPK.class) |
| 15 | public class ArticleBranchTip extends PanacheEntityBase { |
| 16 | |
| 17 | private Integer articleId; |
| 18 | private Integer revisionId; |
| 19 | |
| 20 | @Basic |
| 21 | @Column(name = "article", nullable = true) |
| 22 | @Id |
| 23 | public Integer getArticleId() { |
| 24 | return articleId; |
| 25 | } |
| 26 | |
| 27 | public void setArticleId(Integer articleId) { |
| 28 | this.articleId = articleId; |
| 29 | } |
| 30 | |
| 31 | @Basic |
| 32 | @Column(name = "revision", nullable = true) |
| 33 | @Id |
| 34 | public Integer getRevisionId() { |
| 35 | return revisionId; |
| 36 | } |
| 37 | |
| 38 | public void setRevisionId(Integer revision) { |
| 39 | this.revisionId = revision; |
| 40 | } |
| 41 | |
| 42 | @Override |
| 43 | public boolean equals(Object o) { |
| 44 | if (this == o) { |
| 45 | return true; |
| 46 | } |
| 47 | if (o == null || getClass() != o.getClass()) { |
| 48 | return false; |
| 49 | } |
| 50 | ArticleBranchTip that = (ArticleBranchTip) o; |
| 51 | return Objects.equals(articleId, that.articleId) && |
| 52 | Objects.equals(revisionId, that.revisionId); |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | public int hashCode() { |
| 57 | return Objects.hash(articleId, revisionId); |
| 58 | } |
| 59 | } |