blob: 7599984f485906ee5bb2c93aad3b8202e388b45c [file] [log] [blame]
Matthias Andreas Benkard2f0b3702020-01-12 15:46:34 +01001package eu.mulk.entity;
2
3import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
4import java.util.Objects;
5import javax.persistence.Column;
6import javax.persistence.Entity;
7import javax.persistence.Id;
8import javax.persistence.JoinColumn;
9import javax.persistence.ManyToOne;
10import javax.persistence.Table;
11
12@Entity
13@Table(name = "article_aliases", schema = "public", catalog = "mulkcms")
14public class ArticleAlias extends PanacheEntityBase {
15
16 private String alias;
17 private Article article;
18
19 @Id
20 @Column(name = "alias", nullable = false, length = -1)
21 public String getAlias() {
22 return alias;
23 }
24
25 public void setAlias(String alias) {
26 this.alias = alias;
27 }
28
29 @Override
30 public boolean equals(Object o) {
31 if (this == o) {
32 return true;
33 }
34 if (o == null || getClass() != o.getClass()) {
35 return false;
36 }
37 ArticleAlias that = (ArticleAlias) o;
38 return Objects.equals(alias, that.alias);
39 }
40
41 @Override
42 public int hashCode() {
43 return Objects.hash(alias);
44 }
45
46 @ManyToOne
47 @JoinColumn(name = "article", referencedColumnName = "id", nullable = false)
48 public Article getArticle() {
49 return article;
50 }
51
52 public void setArticle(Article article) {
53 this.article = article;
54 }
55}