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.Collection; |
| 5 | import java.util.Objects; |
| 6 | import javax.persistence.Basic; |
| 7 | import javax.persistence.Column; |
| 8 | import javax.persistence.Entity; |
| 9 | import javax.persistence.Id; |
| 10 | import javax.persistence.OneToMany; |
| 11 | import javax.persistence.Table; |
| 12 | |
| 13 | @Entity |
| 14 | @Table(name = "journal_entry", schema = "public", catalog = "mulkcms") |
| 15 | public class LegacyJournalEntry extends PanacheEntityBase { |
| 16 | |
| 17 | private int id; |
| 18 | private String uuid; |
| 19 | private String title; |
| 20 | private long date; |
| 21 | private Long lastModification; |
| 22 | private String body; |
| 23 | private String type; |
| 24 | private Collection<LegacyJournalComment> comments; |
| 25 | private Collection<LegacyJournalPingback> pingbacks; |
| 26 | private Collection<LegacyJournalTrackback> trackbacks; |
| 27 | |
| 28 | @Id |
| 29 | @Column(name = "id", nullable = false) |
| 30 | public int getId() { |
| 31 | return id; |
| 32 | } |
| 33 | |
| 34 | public void setId(int id) { |
| 35 | this.id = id; |
| 36 | } |
| 37 | |
| 38 | @Basic |
| 39 | @Column(name = "uuid", nullable = false, length = 36) |
| 40 | public String getUuid() { |
| 41 | return uuid; |
| 42 | } |
| 43 | |
| 44 | public void setUuid(String uuid) { |
| 45 | this.uuid = uuid; |
| 46 | } |
| 47 | |
| 48 | @Basic |
| 49 | @Column(name = "title", nullable = false, length = -1) |
| 50 | public String getTitle() { |
| 51 | return title; |
| 52 | } |
| 53 | |
| 54 | public void setTitle(String title) { |
| 55 | this.title = title; |
| 56 | } |
| 57 | |
| 58 | @Basic |
| 59 | @Column(name = "date", nullable = false) |
| 60 | public long getDate() { |
| 61 | return date; |
| 62 | } |
| 63 | |
| 64 | public void setDate(long date) { |
| 65 | this.date = date; |
| 66 | } |
| 67 | |
| 68 | @Basic |
| 69 | @Column(name = "last_modification", nullable = true) |
| 70 | public Long getLastModification() { |
| 71 | return lastModification; |
| 72 | } |
| 73 | |
| 74 | public void setLastModification(Long lastModification) { |
| 75 | this.lastModification = lastModification; |
| 76 | } |
| 77 | |
| 78 | @Basic |
| 79 | @Column(name = "body", nullable = false, length = -1) |
| 80 | public String getBody() { |
| 81 | return body; |
| 82 | } |
| 83 | |
| 84 | public void setBody(String body) { |
| 85 | this.body = body; |
| 86 | } |
| 87 | |
| 88 | @Basic |
| 89 | @Column(name = "type", nullable = false, length = -1) |
| 90 | public String getType() { |
| 91 | return type; |
| 92 | } |
| 93 | |
| 94 | public void setType(String type) { |
| 95 | this.type = type; |
| 96 | } |
| 97 | |
| 98 | @Override |
| 99 | public boolean equals(Object o) { |
| 100 | if (this == o) { |
| 101 | return true; |
| 102 | } |
| 103 | if (o == null || getClass() != o.getClass()) { |
| 104 | return false; |
| 105 | } |
| 106 | LegacyJournalEntry that = (LegacyJournalEntry) o; |
| 107 | return id == that.id && |
| 108 | date == that.date && |
| 109 | Objects.equals(uuid, that.uuid) && |
| 110 | Objects.equals(title, that.title) && |
| 111 | Objects.equals(lastModification, that.lastModification) && |
| 112 | Objects.equals(body, that.body) && |
| 113 | Objects.equals(type, that.type); |
| 114 | } |
| 115 | |
| 116 | @Override |
| 117 | public int hashCode() { |
| 118 | return Objects.hash(id, uuid, title, date, lastModification, body, type); |
| 119 | } |
| 120 | |
| 121 | @OneToMany(mappedBy = "journalEntry") |
| 122 | public Collection<LegacyJournalComment> getComments() { |
| 123 | return comments; |
| 124 | } |
| 125 | |
| 126 | public void setComments(Collection<LegacyJournalComment> comments) { |
| 127 | this.comments = comments; |
| 128 | } |
| 129 | |
| 130 | @OneToMany(mappedBy = "journalEntry") |
| 131 | public Collection<LegacyJournalPingback> getPingbacks() { |
| 132 | return pingbacks; |
| 133 | } |
| 134 | |
| 135 | public void setPingbacks(Collection<LegacyJournalPingback> pingbacks) { |
| 136 | this.pingbacks = pingbacks; |
| 137 | } |
| 138 | |
| 139 | @OneToMany(mappedBy = "journalEntry") |
| 140 | public Collection<LegacyJournalTrackback> getTrackbacks() { |
| 141 | return trackbacks; |
| 142 | } |
| 143 | |
| 144 | public void setTrackbacks(Collection<LegacyJournalTrackback> trackbacks) { |
| 145 | this.trackbacks = trackbacks; |
| 146 | } |
| 147 | } |