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.JoinColumn; |
| 10 | import javax.persistence.ManyToOne; |
| 11 | import javax.persistence.Table; |
| 12 | |
| 13 | @Entity |
| 14 | @Table(name = "journal_comment", schema = "public", catalog = "mulkcms") |
| 15 | public class LegacyJournalComment extends PanacheEntityBase { |
| 16 | |
| 17 | private int id; |
| 18 | private String uuid; |
| 19 | private long date; |
| 20 | private String body; |
| 21 | private String author; |
| 22 | private String email; |
| 23 | private String website; |
| 24 | private Boolean spamP; |
| 25 | private String submitterIp; |
| 26 | private String submitterUserAgent; |
| 27 | private LegacyJournalEntry journalEntry; |
| 28 | |
| 29 | @Id |
| 30 | @Column(name = "id", nullable = false) |
| 31 | public int getId() { |
| 32 | return id; |
| 33 | } |
| 34 | |
| 35 | public void setId(int id) { |
| 36 | this.id = id; |
| 37 | } |
| 38 | |
| 39 | @Basic |
| 40 | @Column(name = "uuid", nullable = false, length = 36) |
| 41 | public String getUuid() { |
| 42 | return uuid; |
| 43 | } |
| 44 | |
| 45 | public void setUuid(String uuid) { |
| 46 | this.uuid = uuid; |
| 47 | } |
| 48 | |
| 49 | @Basic |
| 50 | @Column(name = "date", nullable = false) |
| 51 | public long getDate() { |
| 52 | return date; |
| 53 | } |
| 54 | |
| 55 | public void setDate(long date) { |
| 56 | this.date = date; |
| 57 | } |
| 58 | |
| 59 | @Basic |
| 60 | @Column(name = "body", nullable = false, length = -1) |
| 61 | public String getBody() { |
| 62 | return body; |
| 63 | } |
| 64 | |
| 65 | public void setBody(String body) { |
| 66 | this.body = body; |
| 67 | } |
| 68 | |
| 69 | @Basic |
| 70 | @Column(name = "author", nullable = true, length = -1) |
| 71 | public String getAuthor() { |
| 72 | return author; |
| 73 | } |
| 74 | |
| 75 | public void setAuthor(String author) { |
| 76 | this.author = author; |
| 77 | } |
| 78 | |
| 79 | @Basic |
| 80 | @Column(name = "email", nullable = true, length = -1) |
| 81 | public String getEmail() { |
| 82 | return email; |
| 83 | } |
| 84 | |
| 85 | public void setEmail(String email) { |
| 86 | this.email = email; |
| 87 | } |
| 88 | |
| 89 | @Basic |
| 90 | @Column(name = "website", nullable = true, length = -1) |
| 91 | public String getWebsite() { |
| 92 | return website; |
| 93 | } |
| 94 | |
| 95 | public void setWebsite(String website) { |
| 96 | this.website = website; |
| 97 | } |
| 98 | |
| 99 | @Basic |
| 100 | @Column(name = "spam_p", nullable = true) |
| 101 | public Boolean getSpamP() { |
| 102 | return spamP; |
| 103 | } |
| 104 | |
| 105 | public void setSpamP(Boolean spamP) { |
| 106 | this.spamP = spamP; |
| 107 | } |
| 108 | |
| 109 | @Basic |
| 110 | @Column(name = "submitter_ip", nullable = false, length = -1) |
| 111 | public String getSubmitterIp() { |
| 112 | return submitterIp; |
| 113 | } |
| 114 | |
| 115 | public void setSubmitterIp(String submitterIp) { |
| 116 | this.submitterIp = submitterIp; |
| 117 | } |
| 118 | |
| 119 | @Basic |
| 120 | @Column(name = "submitter_user_agent", nullable = false, length = -1) |
| 121 | public String getSubmitterUserAgent() { |
| 122 | return submitterUserAgent; |
| 123 | } |
| 124 | |
| 125 | public void setSubmitterUserAgent(String submitterUserAgent) { |
| 126 | this.submitterUserAgent = submitterUserAgent; |
| 127 | } |
| 128 | |
| 129 | @Override |
| 130 | public boolean equals(Object o) { |
| 131 | if (this == o) { |
| 132 | return true; |
| 133 | } |
| 134 | if (o == null || getClass() != o.getClass()) { |
| 135 | return false; |
| 136 | } |
| 137 | LegacyJournalComment that = (LegacyJournalComment) o; |
| 138 | return id == that.id && |
| 139 | date == that.date && |
| 140 | Objects.equals(uuid, that.uuid) && |
| 141 | Objects.equals(body, that.body) && |
| 142 | Objects.equals(author, that.author) && |
| 143 | Objects.equals(email, that.email) && |
| 144 | Objects.equals(website, that.website) && |
| 145 | Objects.equals(spamP, that.spamP) && |
| 146 | Objects.equals(submitterIp, that.submitterIp) && |
| 147 | Objects.equals(submitterUserAgent, that.submitterUserAgent); |
| 148 | } |
| 149 | |
| 150 | @Override |
| 151 | public int hashCode() { |
| 152 | return Objects |
| 153 | .hash(id, uuid, date, body, author, email, website, spamP, submitterIp, submitterUserAgent); |
| 154 | } |
| 155 | |
| 156 | @ManyToOne |
| 157 | @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false) |
| 158 | public LegacyJournalEntry getJournalEntry() { |
| 159 | return journalEntry; |
| 160 | } |
| 161 | |
| 162 | public void setJournalEntry(LegacyJournalEntry journalEntry) { |
| 163 | this.journalEntry = journalEntry; |
| 164 | } |
| 165 | } |