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 = "users", schema = "public", catalog = "mulkcms") |
| 15 | public class User extends PanacheEntityBase { |
| 16 | |
| 17 | private int id; |
| 18 | private String name; |
| 19 | private String status; |
| 20 | private String email; |
| 21 | private String website; |
| 22 | private Collection<ArticleRevision> articleRevisions; |
| 23 | private Collection<CommentRevision> commentRevisions; |
| 24 | private Collection<LoginCertificate> loginCertificates; |
| 25 | private Collection<OpenId> openids; |
| 26 | private Collection<Password> passwords; |
| 27 | private Collection<UserPermission> userPermissions; |
| 28 | private Collection<UserSetting> userSettings; |
| 29 | |
| 30 | @Id |
| 31 | @Column(name = "id", nullable = false) |
| 32 | public int getId() { |
| 33 | return id; |
| 34 | } |
| 35 | |
| 36 | public void setId(int id) { |
| 37 | this.id = id; |
| 38 | } |
| 39 | |
| 40 | @Basic |
| 41 | @Column(name = "name", nullable = true, length = -1) |
| 42 | public String getName() { |
| 43 | return name; |
| 44 | } |
| 45 | |
| 46 | public void setName(String name) { |
| 47 | this.name = name; |
| 48 | } |
| 49 | |
| 50 | @Basic |
| 51 | @Column(name = "status", nullable = false, length = -1) |
| 52 | public String getStatus() { |
| 53 | return status; |
| 54 | } |
| 55 | |
| 56 | public void setStatus(String status) { |
| 57 | this.status = status; |
| 58 | } |
| 59 | |
| 60 | @Basic |
| 61 | @Column(name = "email", nullable = true, length = -1) |
| 62 | public String getEmail() { |
| 63 | return email; |
| 64 | } |
| 65 | |
| 66 | public void setEmail(String email) { |
| 67 | this.email = email; |
| 68 | } |
| 69 | |
| 70 | @Basic |
| 71 | @Column(name = "website", nullable = true, length = -1) |
| 72 | public String getWebsite() { |
| 73 | return website; |
| 74 | } |
| 75 | |
| 76 | public void setWebsite(String website) { |
| 77 | this.website = website; |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | public boolean equals(Object o) { |
| 82 | if (this == o) { |
| 83 | return true; |
| 84 | } |
| 85 | if (o == null || getClass() != o.getClass()) { |
| 86 | return false; |
| 87 | } |
| 88 | User user = (User) o; |
| 89 | return id == user.id && |
| 90 | Objects.equals(name, user.name) && |
| 91 | Objects.equals(status, user.status) && |
| 92 | Objects.equals(email, user.email) && |
| 93 | Objects.equals(website, user.website); |
| 94 | } |
| 95 | |
| 96 | @Override |
| 97 | public int hashCode() { |
| 98 | return Objects.hash(id, name, status, email, website); |
| 99 | } |
| 100 | |
| 101 | @OneToMany(mappedBy = "authors") |
| 102 | public Collection<ArticleRevision> getArticleRevisions() { |
| 103 | return articleRevisions; |
| 104 | } |
| 105 | |
| 106 | public void setArticleRevisions(Collection<ArticleRevision> articleRevisions) { |
| 107 | this.articleRevisions = articleRevisions; |
| 108 | } |
| 109 | |
| 110 | @OneToMany(mappedBy = "user") |
| 111 | public Collection<CommentRevision> getCommentRevisions() { |
| 112 | return commentRevisions; |
| 113 | } |
| 114 | |
| 115 | public void setCommentRevisions(Collection<CommentRevision> commentRevisions) { |
| 116 | this.commentRevisions = commentRevisions; |
| 117 | } |
| 118 | |
| 119 | @OneToMany(mappedBy = "user") |
| 120 | public Collection<LoginCertificate> getLoginCertificates() { |
| 121 | return loginCertificates; |
| 122 | } |
| 123 | |
| 124 | public void setLoginCertificates(Collection<LoginCertificate> loginCertificates) { |
| 125 | this.loginCertificates = loginCertificates; |
| 126 | } |
| 127 | |
| 128 | @OneToMany(mappedBy = "user") |
| 129 | public Collection<OpenId> getOpenids() { |
| 130 | return openids; |
| 131 | } |
| 132 | |
| 133 | public void setOpenids(Collection<OpenId> openids) { |
| 134 | this.openids = openids; |
| 135 | } |
| 136 | |
| 137 | @OneToMany(mappedBy = "user") |
| 138 | public Collection<Password> getPasswords() { |
| 139 | return passwords; |
| 140 | } |
| 141 | |
| 142 | public void setPasswords(Collection<Password> passwords) { |
| 143 | this.passwords = passwords; |
| 144 | } |
| 145 | |
| 146 | @OneToMany(mappedBy = "user") |
| 147 | public Collection<UserPermission> getUserPermissions() { |
| 148 | return userPermissions; |
| 149 | } |
| 150 | |
| 151 | public void setUserPermissions(Collection<UserPermission> userPermissions) { |
| 152 | this.userPermissions = userPermissions; |
| 153 | } |
| 154 | |
| 155 | @OneToMany(mappedBy = "user") |
| 156 | public Collection<UserSetting> getUserSettings() { |
| 157 | return userSettings; |
| 158 | } |
| 159 | |
| 160 | public void setUserSettings(Collection<UserSetting> userSettings) { |
| 161 | this.userSettings = userSettings; |
| 162 | } |
| 163 | } |