From 734879e8c386508d12c43aaf5b938e050d47c7b7 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 24 Jan 2020 10:47:37 +0100 Subject: Import Benki data model. Change-Id: If17035f96afa56eb409fcab9d8038d885adf607b --- src/main/java/eu/mulk/mulkcms2/benki/Bookmark.java | 134 ++++++++++ .../java/eu/mulk/mulkcms2/benki/BookmarkTag.java | 77 ++++++ .../java/eu/mulk/mulkcms2/benki/BookmarkTagPK.java | 59 +++++ .../mulk/mulkcms2/benki/EffectiveRoleSubrole.java | 62 +++++ .../eu/mulk/mulkcms2/benki/EffectiveUserRole.java | 62 +++++ .../eu/mulk/mulkcms2/benki/LazychatMessage.java | 118 +++++++++ .../eu/mulk/mulkcms2/benki/LazychatReference.java | 77 ++++++ .../mulk/mulkcms2/benki/LazychatReferencePK.java | 59 +++++ src/main/java/eu/mulk/mulkcms2/benki/Openids.java | 57 ++++ src/main/java/eu/mulk/mulkcms2/benki/PageKey.java | 78 ++++++ .../java/eu/mulk/mulkcms2/benki/PageKeyPK.java | 60 +++++ src/main/java/eu/mulk/mulkcms2/benki/Post.java | 76 ++++++ .../java/eu/mulk/mulkcms2/benki/PostTarget.java | 77 ++++++ .../java/eu/mulk/mulkcms2/benki/PostTargetPK.java | 59 +++++ src/main/java/eu/mulk/mulkcms2/benki/Role.java | 126 +++++++++ .../java/eu/mulk/mulkcms2/benki/RoleSubrole.java | 88 +++++++ .../java/eu/mulk/mulkcms2/benki/RoleSubrolePK.java | 59 +++++ src/main/java/eu/mulk/mulkcms2/benki/RoleTag.java | 64 +++++ .../java/eu/mulk/mulkcms2/benki/RoleTagPK.java | 59 +++++ src/main/java/eu/mulk/mulkcms2/benki/RsaKey.java | 77 ++++++ src/main/java/eu/mulk/mulkcms2/benki/RsaKeyPK.java | 60 +++++ src/main/java/eu/mulk/mulkcms2/benki/User.java | 287 +++++++++++++++++++++ .../eu/mulk/mulkcms2/benki/UserDefaultTarget.java | 88 +++++++ .../mulk/mulkcms2/benki/UserDefaultTargetPK.java | 59 +++++ .../eu/mulk/mulkcms2/benki/UserEmailAddress.java | 59 +++++ src/main/java/eu/mulk/mulkcms2/benki/UserJid.java | 77 ++++++ .../java/eu/mulk/mulkcms2/benki/UserJidPK.java | 59 +++++ .../java/eu/mulk/mulkcms2/benki/UserNickname.java | 59 +++++ src/main/java/eu/mulk/mulkcms2/benki/UserRole.java | 88 +++++++ .../java/eu/mulk/mulkcms2/benki/UserRolePK.java | 59 +++++ .../java/eu/mulk/mulkcms2/benki/UserRsaKey.java | 107 ++++++++ .../java/eu/mulk/mulkcms2/benki/UserRsaKeyPK.java | 75 ++++++ .../mulk/mulkcms2/benki/UserVisibleBookmark.java | 62 +++++ .../mulkcms2/benki/UserVisibleLazychatMessage.java | 62 +++++ .../eu/mulk/mulkcms2/benki/UserVisiblePost.java | 62 +++++ src/main/java/eu/mulk/mulkcms2/benki/WebId.java | 59 +++++ src/main/java/eu/mulk/mulkcms2/benki/WikiPage.java | 58 +++++ .../eu/mulk/mulkcms2/benki/WikiPageRevision.java | 132 ++++++++++ 38 files changed, 3040 insertions(+) create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/Bookmark.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/BookmarkTag.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/BookmarkTagPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/EffectiveRoleSubrole.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/EffectiveUserRole.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/LazychatMessage.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/LazychatReference.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/LazychatReferencePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/Openids.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/PageKey.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/PageKeyPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/Post.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/PostTarget.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/PostTargetPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/Role.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/RoleSubrole.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/RoleSubrolePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/RoleTag.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/RoleTagPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/RsaKey.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/RsaKeyPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/User.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTarget.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTargetPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserEmailAddress.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserJid.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserJidPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserNickname.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserRole.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserRolePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserRsaKey.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserRsaKeyPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserVisibleBookmark.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserVisibleLazychatMessage.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/UserVisiblePost.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/WebId.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/WikiPage.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/WikiPageRevision.java diff --git a/src/main/java/eu/mulk/mulkcms2/benki/Bookmark.java b/src/main/java/eu/mulk/mulkcms2/benki/Bookmark.java new file mode 100644 index 0000000..efb81cb --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/Bookmark.java @@ -0,0 +1,134 @@ +package eu.mulk.mulkcms2.benki; + +import java.util.Collection; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "bookmarks", schema = "public", catalog = "benki") +public class Bookmark { + + private int id; + private Object date; + private String uri; + private String title; + private String description; + private Collection tags; + private User owner; + + @Id + @Column(name = "id", nullable = false) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Basic + @Column(name = "date", nullable = true) + public Object getDate() { + return date; + } + + public void setDate(Object date) { + this.date = date; + } + + @Basic + @Column(name = "uri", nullable = false, length = -1) + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + @Basic + @Column(name = "title", nullable = true, length = -1) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + @Basic + @Column(name = "description", nullable = true, length = -1) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Bookmark bookmark = (Bookmark) o; + + if (id != bookmark.id) { + return false; + } + if (date != null ? !date.equals(bookmark.date) : bookmark.date != null) { + return false; + } + if (uri != null ? !uri.equals(bookmark.uri) : bookmark.uri != null) { + return false; + } + if (title != null ? !title.equals(bookmark.title) : bookmark.title != null) { + return false; + } + if (description != null ? !description.equals(bookmark.description) + : bookmark.description != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + (date != null ? date.hashCode() : 0); + result = 31 * result + (uri != null ? uri.hashCode() : 0); + result = 31 * result + (title != null ? title.hashCode() : 0); + result = 31 * result + (description != null ? description.hashCode() : 0); + return result; + } + + @OneToMany(mappedBy = "bookmark") + public Collection getTags() { + return tags; + } + + public void setTags(Collection tags) { + this.tags = tags; + } + + @ManyToOne + @JoinColumn(name = "owner", referencedColumnName = "id") + public User getOwner() { + return owner; + } + + public void setOwner(User owner) { + this.owner = owner; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/BookmarkTag.java b/src/main/java/eu/mulk/mulkcms2/benki/BookmarkTag.java new file mode 100644 index 0000000..1de1f36 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/BookmarkTag.java @@ -0,0 +1,77 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "bookmark_tags", schema = "public", catalog = "benki") +@IdClass(BookmarkTagPK.class) +public class BookmarkTag { + + private int bookmarkId; + private String tag; + private Bookmark bookmark; + + @Id + @Column(name = "bookmark", nullable = false) + public int getBookmarkId() { + return bookmarkId; + } + + public void setBookmarkId(int bookmarkId) { + this.bookmarkId = bookmarkId; + } + + @Id + @Column(name = "tag", nullable = false, length = -1) + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + BookmarkTag that = (BookmarkTag) o; + + if (bookmarkId != that.bookmarkId) { + return false; + } + if (tag != null ? !tag.equals(that.tag) : that.tag != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = bookmarkId; + result = 31 * result + (tag != null ? tag.hashCode() : 0); + return result; + } + + @ManyToOne + @JoinColumn(name = "bookmark", referencedColumnName = "id", nullable = false) + public Bookmark getBookmark() { + return bookmark; + } + + public void setBookmark(Bookmark bookmark) { + this.bookmark = bookmark; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/BookmarkTagPK.java b/src/main/java/eu/mulk/mulkcms2/benki/BookmarkTagPK.java new file mode 100644 index 0000000..89e7fb9 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/BookmarkTagPK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class BookmarkTagPK implements Serializable { + + private int bookmarkId; + private String tag; + + @Column(name = "bookmark", nullable = false) + @Id + public int getBookmarkId() { + return bookmarkId; + } + + public void setBookmarkId(int bookmarkId) { + this.bookmarkId = bookmarkId; + } + + @Column(name = "tag", nullable = false, length = -1) + @Id + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + BookmarkTagPK that = (BookmarkTagPK) o; + + if (bookmarkId != that.bookmarkId) { + return false; + } + if (tag != null ? !tag.equals(that.tag) : that.tag != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = bookmarkId; + result = 31 * result + (tag != null ? tag.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/EffectiveRoleSubrole.java b/src/main/java/eu/mulk/mulkcms2/benki/EffectiveRoleSubrole.java new file mode 100644 index 0000000..a72c9db --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/EffectiveRoleSubrole.java @@ -0,0 +1,62 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "effective_role_subroles", schema = "public", catalog = "benki") +public class EffectiveRoleSubrole { + + private Integer superroleId; + private Integer subroleId; + + @Basic + @Column(name = "superrole", nullable = true) + public Integer getSuperroleId() { + return superroleId; + } + + public void setSuperroleId(Integer superroleId) { + this.superroleId = superroleId; + } + + @Basic + @Column(name = "subrole", nullable = true) + public Integer getSubroleId() { + return subroleId; + } + + public void setSubroleId(Integer subroleId) { + this.subroleId = subroleId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + EffectiveRoleSubrole that = (EffectiveRoleSubrole) o; + + if (superroleId != null ? !superroleId.equals(that.superroleId) : that.superroleId != null) { + return false; + } + if (subroleId != null ? !subroleId.equals(that.subroleId) : that.subroleId != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = superroleId != null ? superroleId.hashCode() : 0; + result = 31 * result + (subroleId != null ? subroleId.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/EffectiveUserRole.java b/src/main/java/eu/mulk/mulkcms2/benki/EffectiveUserRole.java new file mode 100644 index 0000000..00c5738 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/EffectiveUserRole.java @@ -0,0 +1,62 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "effective_user_roles", schema = "public", catalog = "benki") +public class EffectiveUserRole { + + private Integer userId; + private Integer roleId; + + @Basic + @Column(name = "user", nullable = true) + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + @Basic + @Column(name = "role", nullable = true) + public Integer getRoleId() { + return roleId; + } + + public void setRoleId(Integer roleId) { + this.roleId = roleId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + EffectiveUserRole that = (EffectiveUserRole) o; + + if (userId != null ? !userId.equals(that.userId) : that.userId != null) { + return false; + } + if (roleId != null ? !roleId.equals(that.roleId) : that.roleId != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId != null ? userId.hashCode() : 0; + result = 31 * result + (roleId != null ? roleId.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/LazychatMessage.java b/src/main/java/eu/mulk/mulkcms2/benki/LazychatMessage.java new file mode 100644 index 0000000..97d3365 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/LazychatMessage.java @@ -0,0 +1,118 @@ +package eu.mulk.mulkcms2.benki; + +import java.util.Collection; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "lazychat_messages", schema = "public", catalog = "benki") +public class LazychatMessage { + + private int id; + private Object date; + private String content; + private String format; + private User owner; + private Collection references; + + @Id + @Column(name = "id", nullable = false) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Basic + @Column(name = "date", nullable = true) + public Object getDate() { + return date; + } + + public void setDate(Object date) { + this.date = date; + } + + @Basic + @Column(name = "content", nullable = true, length = -1) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + @Basic + @Column(name = "format", nullable = false, length = -1) + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LazychatMessage that = (LazychatMessage) o; + + if (id != that.id) { + return false; + } + if (date != null ? !date.equals(that.date) : that.date != null) { + return false; + } + if (content != null ? !content.equals(that.content) : that.content != null) { + return false; + } + if (format != null ? !format.equals(that.format) : that.format != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + (date != null ? date.hashCode() : 0); + result = 31 * result + (content != null ? content.hashCode() : 0); + result = 31 * result + (format != null ? format.hashCode() : 0); + return result; + } + + @ManyToOne + @JoinColumn(name = "owner", referencedColumnName = "id") + public User getOwner() { + return owner; + } + + public void setOwner(User owner) { + this.owner = owner; + } + + @OneToMany(mappedBy = "referrer") + public Collection getReferences() { + return references; + } + + public void setReferences(Collection references) { + this.references = references; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/LazychatReference.java b/src/main/java/eu/mulk/mulkcms2/benki/LazychatReference.java new file mode 100644 index 0000000..330e607 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/LazychatReference.java @@ -0,0 +1,77 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "lazychat_references", schema = "public", catalog = "benki") +@IdClass(LazychatReferencePK.class) +public class LazychatReference { + + private int referrerId; + private int refereeId; + private LazychatMessage referrer; + + @Id + @Column(name = "referrer", nullable = false) + public int getReferrerId() { + return referrerId; + } + + public void setReferrerId(int referrerId) { + this.referrerId = referrerId; + } + + @Id + @Column(name = "referee", nullable = false) + public int getRefereeId() { + return refereeId; + } + + public void setRefereeId(int refereeId) { + this.refereeId = refereeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LazychatReference that = (LazychatReference) o; + + if (referrerId != that.referrerId) { + return false; + } + if (refereeId != that.refereeId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = referrerId; + result = 31 * result + refereeId; + return result; + } + + @ManyToOne + @JoinColumn(name = "referrer", referencedColumnName = "id", nullable = false) + public LazychatMessage getReferrer() { + return referrer; + } + + public void setReferrer(LazychatMessage referrer) { + this.referrer = referrer; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/LazychatReferencePK.java b/src/main/java/eu/mulk/mulkcms2/benki/LazychatReferencePK.java new file mode 100644 index 0000000..c7eefc0 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/LazychatReferencePK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class LazychatReferencePK implements Serializable { + + private int referrerId; + private int refereeId; + + @Column(name = "referrer", nullable = false) + @Id + public int getReferrerId() { + return referrerId; + } + + public void setReferrerId(int referrerId) { + this.referrerId = referrerId; + } + + @Column(name = "referee", nullable = false) + @Id + public int getRefereeId() { + return refereeId; + } + + public void setRefereeId(int refereeId) { + this.refereeId = refereeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LazychatReferencePK that = (LazychatReferencePK) o; + + if (referrerId != that.referrerId) { + return false; + } + if (refereeId != that.refereeId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = referrerId; + result = 31 * result + refereeId; + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/Openids.java b/src/main/java/eu/mulk/mulkcms2/benki/Openids.java new file mode 100644 index 0000000..c56fe4c --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/Openids.java @@ -0,0 +1,57 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; + +@Entity +public class Openids { + + private String openid; + private User user; + + @Id + @Column(name = "openid", nullable = false, length = -1) + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Openids openids = (Openids) o; + + if (openid != null ? !openid.equals(openids.openid) : openids.openid != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + return openid != null ? openid.hashCode() : 0; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/PageKey.java b/src/main/java/eu/mulk/mulkcms2/benki/PageKey.java new file mode 100644 index 0000000..1423e00 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/PageKey.java @@ -0,0 +1,78 @@ +package eu.mulk.mulkcms2.benki; + +import java.math.BigInteger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "page_keys", schema = "public", catalog = "benki") +@IdClass(PageKeyPK.class) +public class PageKey { + + private String page; + private BigInteger key; + private User user; + + @Id + @Column(name = "page", nullable = false, length = -1) + public String getPage() { + return page; + } + + public void setPage(String page) { + this.page = page; + } + + @Id + @Column(name = "key", nullable = false, precision = 0) + public BigInteger getKey() { + return key; + } + + public void setKey(BigInteger key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + PageKey pageKey = (PageKey) o; + + if (page != null ? !page.equals(pageKey.page) : pageKey.page != null) { + return false; + } + if (key != null ? !key.equals(pageKey.key) : pageKey.key != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = page != null ? page.hashCode() : 0; + result = 31 * result + (key != null ? key.hashCode() : 0); + return result; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/PageKeyPK.java b/src/main/java/eu/mulk/mulkcms2/benki/PageKeyPK.java new file mode 100644 index 0000000..dea94ed --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/PageKeyPK.java @@ -0,0 +1,60 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import java.math.BigInteger; +import javax.persistence.Column; +import javax.persistence.Id; + +public class PageKeyPK implements Serializable { + + private String page; + private BigInteger key; + + @Column(name = "page", nullable = false, length = -1) + @Id + public String getPage() { + return page; + } + + public void setPage(String page) { + this.page = page; + } + + @Column(name = "key", nullable = false, precision = 0) + @Id + public BigInteger getKey() { + return key; + } + + public void setKey(BigInteger key) { + this.key = key; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + PageKeyPK pageKeyPK = (PageKeyPK) o; + + if (page != null ? !page.equals(pageKeyPK.page) : pageKeyPK.page != null) { + return false; + } + if (key != null ? !key.equals(pageKeyPK.key) : pageKeyPK.key != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = page != null ? page.hashCode() : 0; + result = 31 * result + (key != null ? key.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/Post.java b/src/main/java/eu/mulk/mulkcms2/benki/Post.java new file mode 100644 index 0000000..ba448c6 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/Post.java @@ -0,0 +1,76 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "posts", schema = "public", catalog = "benki") +public class Post { + + private int id; + private Object date; + private User owner; + + @Id + @Column(name = "id", nullable = false) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Basic + @Column(name = "date", nullable = true) + public Object getDate() { + return date; + } + + public void setDate(Object date) { + this.date = date; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Post post = (Post) o; + + if (id != post.id) { + return false; + } + if (date != null ? !date.equals(post.date) : post.date != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + (date != null ? date.hashCode() : 0); + return result; + } + + @ManyToOne + @JoinColumn(name = "owner", referencedColumnName = "id") + public User getOwner() { + return owner; + } + + public void setOwner(User owner) { + this.owner = owner; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/PostTarget.java b/src/main/java/eu/mulk/mulkcms2/benki/PostTarget.java new file mode 100644 index 0000000..5a01cfa --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/PostTarget.java @@ -0,0 +1,77 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "post_targets", schema = "public", catalog = "benki") +@IdClass(PostTargetPK.class) +public class PostTarget { + + private int message; + private int targetId; + private Role target; + + @Id + @Column(name = "message", nullable = false) + public int getMessage() { + return message; + } + + public void setMessage(int message) { + this.message = message; + } + + @Id + @Column(name = "target", nullable = false) + public int getTargetId() { + return targetId; + } + + public void setTargetId(int targetId) { + this.targetId = targetId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + PostTarget that = (PostTarget) o; + + if (message != that.message) { + return false; + } + if (targetId != that.targetId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = message; + result = 31 * result + targetId; + return result; + } + + @ManyToOne + @JoinColumn(name = "target", referencedColumnName = "id", nullable = false) + public Role getTarget() { + return target; + } + + public void setTarget(Role target) { + this.target = target; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/PostTargetPK.java b/src/main/java/eu/mulk/mulkcms2/benki/PostTargetPK.java new file mode 100644 index 0000000..0189837 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/PostTargetPK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class PostTargetPK implements Serializable { + + private int message; + private int targetId; + + @Column(name = "message", nullable = false) + @Id + public int getMessage() { + return message; + } + + public void setMessage(int message) { + this.message = message; + } + + @Column(name = "target", nullable = false) + @Id + public int getTargetId() { + return targetId; + } + + public void setTargetId(int targetId) { + this.targetId = targetId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + PostTargetPK that = (PostTargetPK) o; + + if (message != that.message) { + return false; + } + if (targetId != that.targetId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = message; + result = 31 * result + targetId; + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/Role.java b/src/main/java/eu/mulk/mulkcms2/benki/Role.java new file mode 100644 index 0000000..ea1c388 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/Role.java @@ -0,0 +1,126 @@ +package eu.mulk.mulkcms2.benki; + +import java.util.Collection; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "roles", schema = "public", catalog = "benki") +public class Role { + + private int id; + private String name; + private Collection targetedPosts; + private Collection subroles; + private Collection superroles; + private Collection usersUsedByAsDefaultTarget; + private Collection users; + private Collection owningUsers; + + @Id + @Column(name = "id", nullable = false) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Basic + @Column(name = "name", nullable = true, length = -1) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Role role = (Role) o; + + if (id != role.id) { + return false; + } + if (name != null ? !name.equals(role.name) : role.name != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + (name != null ? name.hashCode() : 0); + return result; + } + + @OneToMany(mappedBy = "target") + public Collection getTargetedPosts() { + return targetedPosts; + } + + public void setTargetedPosts(Collection targetedPosts) { + this.targetedPosts = targetedPosts; + } + + @OneToMany(mappedBy = "superrole") + public Collection getSubroles() { + return subroles; + } + + public void setSubroles(Collection subroles) { + this.subroles = subroles; + } + + @OneToMany(mappedBy = "subrole") + public Collection getSuperroles() { + return superroles; + } + + public void setSuperroles(Collection superroles) { + this.superroles = superroles; + } + + @OneToMany(mappedBy = "target") + public Collection getUsersUsedByAsDefaultTarget() { + return usersUsedByAsDefaultTarget; + } + + public void setUsersUsedByAsDefaultTarget( + Collection usersUsedByAsDefaultTarget) { + this.usersUsedByAsDefaultTarget = usersUsedByAsDefaultTarget; + } + + @OneToMany(mappedBy = "role") + public Collection getUsers() { + return users; + } + + public void setUsers(Collection users) { + this.users = users; + } + + @OneToMany(mappedBy = "ownedRole") + public Collection getOwningUsers() { + return owningUsers; + } + + public void setOwningUsers(Collection owningUsers) { + this.owningUsers = owningUsers; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/RoleSubrole.java b/src/main/java/eu/mulk/mulkcms2/benki/RoleSubrole.java new file mode 100644 index 0000000..12c68ca --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/RoleSubrole.java @@ -0,0 +1,88 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "role_subroles", schema = "public", catalog = "benki") +@IdClass(RoleSubrolePK.class) +public class RoleSubrole { + + private int superroleId; + private int subroleId; + private Role superrole; + private Role subrole; + + @Id + @Column(name = "superrole", nullable = false) + public int getSuperroleId() { + return superroleId; + } + + public void setSuperroleId(int superroleId) { + this.superroleId = superroleId; + } + + @Id + @Column(name = "subrole", nullable = false) + public int getSubroleId() { + return subroleId; + } + + public void setSubroleId(int subroleId) { + this.subroleId = subroleId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RoleSubrole that = (RoleSubrole) o; + + if (superroleId != that.superroleId) { + return false; + } + if (subroleId != that.subroleId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = superroleId; + result = 31 * result + subroleId; + return result; + } + + @ManyToOne + @JoinColumn(name = "superrole", referencedColumnName = "id", nullable = false) + public Role getSuperrole() { + return superrole; + } + + public void setSuperrole(Role superrole) { + this.superrole = superrole; + } + + @ManyToOne + @JoinColumn(name = "subrole", referencedColumnName = "id", nullable = false) + public Role getSubrole() { + return subrole; + } + + public void setSubrole(Role subrole) { + this.subrole = subrole; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/RoleSubrolePK.java b/src/main/java/eu/mulk/mulkcms2/benki/RoleSubrolePK.java new file mode 100644 index 0000000..cf36115 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/RoleSubrolePK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class RoleSubrolePK implements Serializable { + + private int superroleId; + private int subroleId; + + @Column(name = "superrole", nullable = false) + @Id + public int getSuperroleId() { + return superroleId; + } + + public void setSuperroleId(int superroleId) { + this.superroleId = superroleId; + } + + @Column(name = "subrole", nullable = false) + @Id + public int getSubroleId() { + return subroleId; + } + + public void setSubroleId(int subroleId) { + this.subroleId = subroleId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RoleSubrolePK that = (RoleSubrolePK) o; + + if (superroleId != that.superroleId) { + return false; + } + if (subroleId != that.subroleId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = superroleId; + result = 31 * result + subroleId; + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/RoleTag.java b/src/main/java/eu/mulk/mulkcms2/benki/RoleTag.java new file mode 100644 index 0000000..a51bf9c --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/RoleTag.java @@ -0,0 +1,64 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; + +@Entity +@Table(name = "role_tags", schema = "public", catalog = "benki") +@IdClass(RoleTagPK.class) +public class RoleTag { + + private int roleId; + private String tag; + + @Id + @Column(name = "role", nullable = false) + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + @Id + @Column(name = "tag", nullable = false, length = -1) + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RoleTag roleTag = (RoleTag) o; + + if (roleId != roleTag.roleId) { + return false; + } + if (tag != null ? !tag.equals(roleTag.tag) : roleTag.tag != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = roleId; + result = 31 * result + (tag != null ? tag.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/RoleTagPK.java b/src/main/java/eu/mulk/mulkcms2/benki/RoleTagPK.java new file mode 100644 index 0000000..e406e10 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/RoleTagPK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class RoleTagPK implements Serializable { + + private int roleId; + private String tag; + + @Column(name = "role", nullable = false) + @Id + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + @Column(name = "tag", nullable = false, length = -1) + @Id + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RoleTagPK roleTagPK = (RoleTagPK) o; + + if (roleId != roleTagPK.roleId) { + return false; + } + if (tag != null ? !tag.equals(roleTagPK.tag) : roleTagPK.tag != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = roleId; + result = 31 * result + (tag != null ? tag.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/RsaKey.java b/src/main/java/eu/mulk/mulkcms2/benki/RsaKey.java new file mode 100644 index 0000000..f2bbb8a --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/RsaKey.java @@ -0,0 +1,77 @@ +package eu.mulk.mulkcms2.benki; + +import java.math.BigInteger; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "rsa_keys", schema = "public", catalog = "benki") +@IdClass(RsaKeyPK.class) +public class RsaKey { + + private BigInteger modulus; + private BigInteger exponent; + private Collection users; + + @Id + @Column(name = "modulus", nullable = false, precision = 0) + public BigInteger getModulus() { + return modulus; + } + + public void setModulus(BigInteger modulus) { + this.modulus = modulus; + } + + @Id + @Column(name = "exponent", nullable = false, precision = 0) + public BigInteger getExponent() { + return exponent; + } + + public void setExponent(BigInteger exponent) { + this.exponent = exponent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RsaKey rsaKey = (RsaKey) o; + + if (modulus != null ? !modulus.equals(rsaKey.modulus) : rsaKey.modulus != null) { + return false; + } + if (exponent != null ? !exponent.equals(rsaKey.exponent) : rsaKey.exponent != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = modulus != null ? modulus.hashCode() : 0; + result = 31 * result + (exponent != null ? exponent.hashCode() : 0); + return result; + } + + @OneToMany(mappedBy = "rsaKey") + public Collection getUsers() { + return users; + } + + public void setUsers(Collection users) { + this.users = users; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/RsaKeyPK.java b/src/main/java/eu/mulk/mulkcms2/benki/RsaKeyPK.java new file mode 100644 index 0000000..41a332d --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/RsaKeyPK.java @@ -0,0 +1,60 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import java.math.BigInteger; +import javax.persistence.Column; +import javax.persistence.Id; + +public class RsaKeyPK implements Serializable { + + private BigInteger modulus; + private BigInteger exponent; + + @Column(name = "modulus", nullable = false, precision = 0) + @Id + public BigInteger getModulus() { + return modulus; + } + + public void setModulus(BigInteger modulus) { + this.modulus = modulus; + } + + @Column(name = "exponent", nullable = false, precision = 0) + @Id + public BigInteger getExponent() { + return exponent; + } + + public void setExponent(BigInteger exponent) { + this.exponent = exponent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RsaKeyPK rsaKeyPK = (RsaKeyPK) o; + + if (modulus != null ? !modulus.equals(rsaKeyPK.modulus) : rsaKeyPK.modulus != null) { + return false; + } + if (exponent != null ? !exponent.equals(rsaKeyPK.exponent) : rsaKeyPK.exponent != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = modulus != null ? modulus.hashCode() : 0; + result = 31 * result + (exponent != null ? exponent.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/User.java b/src/main/java/eu/mulk/mulkcms2/benki/User.java new file mode 100644 index 0000000..c1160f5 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/User.java @@ -0,0 +1,287 @@ +package eu.mulk.mulkcms2.benki; + +import java.util.Collection; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "users", schema = "public", catalog = "benki") +public class User { + + private int id; + private String firstName; + private String middleNames; + private String lastName; + private String email; + private String website; + private String status; + private Collection bookmarks; + private Collection lazychatMessages; + private Collection openids; + private Collection pageKeys; + private Collection posts; + private Collection defaultTargets; + private Collection emailAddresses; + private Collection jids; + private Collection nicknames; + private Collection roles; + private Collection rsaKeys; + private Role ownedRole; + private Collection webids; + private Collection wikiPageRevisions; + + @Id + @Column(name = "id", nullable = false) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Basic + @Column(name = "first_name", nullable = true, length = -1) + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + @Basic + @Column(name = "middle_names", nullable = true, length = -1) + public String getMiddleNames() { + return middleNames; + } + + public void setMiddleNames(String middleNames) { + this.middleNames = middleNames; + } + + @Basic + @Column(name = "last_name", nullable = true, length = -1) + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + @Basic + @Column(name = "email", nullable = true, length = -1) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Basic + @Column(name = "website", nullable = true, length = -1) + public String getWebsite() { + return website; + } + + public void setWebsite(String website) { + this.website = website; + } + + @Basic + @Column(name = "status", nullable = true, length = -1) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + User user = (User) o; + + if (id != user.id) { + return false; + } + if (firstName != null ? !firstName.equals(user.firstName) : user.firstName != null) { + return false; + } + if (middleNames != null ? !middleNames.equals(user.middleNames) : user.middleNames != null) { + return false; + } + if (lastName != null ? !lastName.equals(user.lastName) : user.lastName != null) { + return false; + } + if (email != null ? !email.equals(user.email) : user.email != null) { + return false; + } + if (website != null ? !website.equals(user.website) : user.website != null) { + return false; + } + if (status != null ? !status.equals(user.status) : user.status != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + (firstName != null ? firstName.hashCode() : 0); + result = 31 * result + (middleNames != null ? middleNames.hashCode() : 0); + result = 31 * result + (lastName != null ? lastName.hashCode() : 0); + result = 31 * result + (email != null ? email.hashCode() : 0); + result = 31 * result + (website != null ? website.hashCode() : 0); + result = 31 * result + (status != null ? status.hashCode() : 0); + return result; + } + + @OneToMany(mappedBy = "owner") + public Collection getBookmarks() { + return bookmarks; + } + + public void setBookmarks(Collection bookmarks) { + this.bookmarks = bookmarks; + } + + @OneToMany(mappedBy = "owner") + public Collection getLazychatMessages() { + return lazychatMessages; + } + + public void setLazychatMessages( + Collection lazychatMessages) { + this.lazychatMessages = lazychatMessages; + } + + @OneToMany(mappedBy = "user") + public Collection getOpenids() { + return openids; + } + + public void setOpenids(Collection openids) { + this.openids = openids; + } + + @OneToMany(mappedBy = "user") + public Collection getPageKeys() { + return pageKeys; + } + + public void setPageKeys(Collection pageKeys) { + this.pageKeys = pageKeys; + } + + @OneToMany(mappedBy = "owner") + public Collection getPosts() { + return posts; + } + + public void setPosts(Collection posts) { + this.posts = posts; + } + + @OneToMany(mappedBy = "user") + public Collection getDefaultTargets() { + return defaultTargets; + } + + public void setDefaultTargets( + Collection defaultTargets) { + this.defaultTargets = defaultTargets; + } + + @OneToMany(mappedBy = "user") + public Collection getEmailAddresses() { + return emailAddresses; + } + + public void setEmailAddresses( + Collection emailAddresses) { + this.emailAddresses = emailAddresses; + } + + @OneToMany(mappedBy = "user") + public Collection getJids() { + return jids; + } + + public void setJids(Collection jids) { + this.jids = jids; + } + + @OneToMany(mappedBy = "user") + public Collection getNicknames() { + return nicknames; + } + + public void setNicknames(Collection nicknames) { + this.nicknames = nicknames; + } + + @OneToMany(mappedBy = "user") + public Collection getRoles() { + return roles; + } + + public void setRoles(Collection roles) { + this.roles = roles; + } + + @OneToMany(mappedBy = "user") + public Collection getRsaKeys() { + return rsaKeys; + } + + public void setRsaKeys(Collection rsaKeys) { + this.rsaKeys = rsaKeys; + } + + @ManyToOne + @JoinColumn(name = "role", referencedColumnName = "id", nullable = false) + public Role getOwnedRole() { + return ownedRole; + } + + public void setOwnedRole(Role ownedRole) { + this.ownedRole = ownedRole; + } + + @OneToMany(mappedBy = "user") + public Collection getWebids() { + return webids; + } + + public void setWebids(Collection webids) { + this.webids = webids; + } + + @OneToMany(mappedBy = "author") + public Collection getWikiPageRevisions() { + return wikiPageRevisions; + } + + public void setWikiPageRevisions( + Collection wikiPageRevisions) { + this.wikiPageRevisions = wikiPageRevisions; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTarget.java b/src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTarget.java new file mode 100644 index 0000000..40c0082 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTarget.java @@ -0,0 +1,88 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_default_target", schema = "public", catalog = "benki") +@IdClass(UserDefaultTargetPK.class) +public class UserDefaultTarget { + + private int userId; + private int targetId; + private User user; + private Role target; + + @Id + @Column(name = "user", nullable = false) + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Id + @Column(name = "target", nullable = false) + public int getTargetId() { + return targetId; + } + + public void setTargetId(int targetId) { + this.targetId = targetId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserDefaultTarget that = (UserDefaultTarget) o; + + if (userId != that.userId) { + return false; + } + if (targetId != that.targetId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + targetId; + return result; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @ManyToOne + @JoinColumn(name = "target", referencedColumnName = "id", nullable = false) + public Role getTarget() { + return target; + } + + public void setTarget(Role target) { + this.target = target; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTargetPK.java b/src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTargetPK.java new file mode 100644 index 0000000..e7e080f --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserDefaultTargetPK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class UserDefaultTargetPK implements Serializable { + + private int userId; + private int targetId; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "target", nullable = false) + @Id + public int getTargetId() { + return targetId; + } + + public void setTargetId(int targetId) { + this.targetId = targetId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserDefaultTargetPK that = (UserDefaultTargetPK) o; + + if (userId != that.userId) { + return false; + } + if (targetId != that.targetId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + targetId; + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserEmailAddress.java b/src/main/java/eu/mulk/mulkcms2/benki/UserEmailAddress.java new file mode 100644 index 0000000..03f2a0f --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserEmailAddress.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_email_addresses", schema = "public", catalog = "benki") +public class UserEmailAddress { + + private String email; + private User user; + + @Id + @Column(name = "email", nullable = false, length = -1) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserEmailAddress that = (UserEmailAddress) o; + + if (email != null ? !email.equals(that.email) : that.email != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + return email != null ? email.hashCode() : 0; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserJid.java b/src/main/java/eu/mulk/mulkcms2/benki/UserJid.java new file mode 100644 index 0000000..468b95a --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserJid.java @@ -0,0 +1,77 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_jids", schema = "public", catalog = "benki") +@IdClass(UserJidPK.class) +public class UserJid { + + private int userId; + private String jid; + private User user; + + @Id + @Column(name = "user", nullable = false) + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Id + @Column(name = "jid", nullable = false, length = -1) + public String getJid() { + return jid; + } + + public void setJid(String jid) { + this.jid = jid; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserJid userJid = (UserJid) o; + + if (userId != userJid.userId) { + return false; + } + if (jid != null ? !jid.equals(userJid.jid) : userJid.jid != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + (jid != null ? jid.hashCode() : 0); + return result; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserJidPK.java b/src/main/java/eu/mulk/mulkcms2/benki/UserJidPK.java new file mode 100644 index 0000000..f033723 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserJidPK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class UserJidPK implements Serializable { + + private int userId; + private String jid; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "jid", nullable = false, length = -1) + @Id + public String getJid() { + return jid; + } + + public void setJid(String jid) { + this.jid = jid; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserJidPK userJidPK = (UserJidPK) o; + + if (userId != userJidPK.userId) { + return false; + } + if (jid != null ? !jid.equals(userJidPK.jid) : userJidPK.jid != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + (jid != null ? jid.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserNickname.java b/src/main/java/eu/mulk/mulkcms2/benki/UserNickname.java new file mode 100644 index 0000000..a6161cc --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserNickname.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_nicknames", schema = "public", catalog = "benki") +public class UserNickname { + + private String nickname; + private User user; + + @Id + @Column(name = "nickname", nullable = false, length = -1) + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserNickname that = (UserNickname) o; + + if (nickname != null ? !nickname.equals(that.nickname) : that.nickname != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + return nickname != null ? nickname.hashCode() : 0; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserRole.java b/src/main/java/eu/mulk/mulkcms2/benki/UserRole.java new file mode 100644 index 0000000..f87b9e4 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserRole.java @@ -0,0 +1,88 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_roles", schema = "public", catalog = "benki") +@IdClass(UserRolePK.class) +public class UserRole { + + private int userId; + private int roleId; + private User user; + private Role role; + + @Id + @Column(name = "user", nullable = false) + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Id + @Column(name = "role", nullable = false) + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserRole userRole = (UserRole) o; + + if (userId != userRole.userId) { + return false; + } + if (roleId != userRole.roleId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + roleId; + return result; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @ManyToOne + @JoinColumn(name = "role", referencedColumnName = "id", nullable = false) + public Role getRole() { + return role; + } + + public void setRole(Role role) { + this.role = role; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserRolePK.java b/src/main/java/eu/mulk/mulkcms2/benki/UserRolePK.java new file mode 100644 index 0000000..6181b8b --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserRolePK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class UserRolePK implements Serializable { + + private int userId; + private int roleId; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "role", nullable = false) + @Id + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserRolePK that = (UserRolePK) o; + + if (userId != that.userId) { + return false; + } + if (roleId != that.roleId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + roleId; + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserRsaKey.java b/src/main/java/eu/mulk/mulkcms2/benki/UserRsaKey.java new file mode 100644 index 0000000..24aff81 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserRsaKey.java @@ -0,0 +1,107 @@ +package eu.mulk.mulkcms2.benki; + +import java.math.BigInteger; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_rsa_keys", schema = "public", catalog = "benki") +@IdClass(UserRsaKeyPK.class) +public class UserRsaKey { + + private int userId; + private BigInteger modulus; + private BigInteger exponent; + private User user; + private RsaKey rsaKey; + + @Id + @Column(name = "user", nullable = false) + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Id + @Column(name = "modulus", nullable = false, precision = 0) + public BigInteger getModulus() { + return modulus; + } + + public void setModulus(BigInteger modulus) { + this.modulus = modulus; + } + + @Id + @Column(name = "exponent", nullable = false, precision = 0) + public BigInteger getExponent() { + return exponent; + } + + public void setExponent(BigInteger exponent) { + this.exponent = exponent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserRsaKey that = (UserRsaKey) o; + + if (userId != that.userId) { + return false; + } + if (modulus != null ? !modulus.equals(that.modulus) : that.modulus != null) { + return false; + } + if (exponent != null ? !exponent.equals(that.exponent) : that.exponent != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + (modulus != null ? modulus.hashCode() : 0); + result = 31 * result + (exponent != null ? exponent.hashCode() : 0); + return result; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @ManyToOne + @JoinColumns({ + @JoinColumn(name = "modulus", referencedColumnName = "modulus", nullable = false), + @JoinColumn(name = "exponent", referencedColumnName = "exponent", nullable = false)}) + public RsaKey getRsaKey() { + return rsaKey; + } + + public void setRsaKey(RsaKey rsaKey) { + this.rsaKey = rsaKey; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserRsaKeyPK.java b/src/main/java/eu/mulk/mulkcms2/benki/UserRsaKeyPK.java new file mode 100644 index 0000000..4c146ae --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserRsaKeyPK.java @@ -0,0 +1,75 @@ +package eu.mulk.mulkcms2.benki; + +import java.io.Serializable; +import java.math.BigInteger; +import javax.persistence.Column; +import javax.persistence.Id; + +public class UserRsaKeyPK implements Serializable { + + private int userId; + private BigInteger modulus; + private BigInteger exponent; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "modulus", nullable = false, precision = 0) + @Id + public BigInteger getModulus() { + return modulus; + } + + public void setModulus(BigInteger modulus) { + this.modulus = modulus; + } + + @Column(name = "exponent", nullable = false, precision = 0) + @Id + public BigInteger getExponent() { + return exponent; + } + + public void setExponent(BigInteger exponent) { + this.exponent = exponent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserRsaKeyPK that = (UserRsaKeyPK) o; + + if (userId != that.userId) { + return false; + } + if (modulus != null ? !modulus.equals(that.modulus) : that.modulus != null) { + return false; + } + if (exponent != null ? !exponent.equals(that.exponent) : that.exponent != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId; + result = 31 * result + (modulus != null ? modulus.hashCode() : 0); + result = 31 * result + (exponent != null ? exponent.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserVisibleBookmark.java b/src/main/java/eu/mulk/mulkcms2/benki/UserVisibleBookmark.java new file mode 100644 index 0000000..5d5cada --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserVisibleBookmark.java @@ -0,0 +1,62 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "user_visible_bookmarks", schema = "public", catalog = "benki") +public class UserVisibleBookmark { + + private Integer userId; + private Integer messageId; + + @Basic + @Column(name = "user", nullable = true) + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + @Basic + @Column(name = "message", nullable = true) + public Integer getMessageId() { + return messageId; + } + + public void setMessageId(Integer messageId) { + this.messageId = messageId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserVisibleBookmark that = (UserVisibleBookmark) o; + + if (userId != null ? !userId.equals(that.userId) : that.userId != null) { + return false; + } + if (messageId != null ? !messageId.equals(that.messageId) : that.messageId != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId != null ? userId.hashCode() : 0; + result = 31 * result + (messageId != null ? messageId.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserVisibleLazychatMessage.java b/src/main/java/eu/mulk/mulkcms2/benki/UserVisibleLazychatMessage.java new file mode 100644 index 0000000..8f5f2ac --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserVisibleLazychatMessage.java @@ -0,0 +1,62 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "user_visible_lazychat_messages", schema = "public", catalog = "benki") +public class UserVisibleLazychatMessage { + + private Integer userId; + private Integer messageId; + + @Basic + @Column(name = "user", nullable = true) + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + @Basic + @Column(name = "message", nullable = true) + public Integer getMessageId() { + return messageId; + } + + public void setMessageId(Integer messageId) { + this.messageId = messageId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserVisibleLazychatMessage that = (UserVisibleLazychatMessage) o; + + if (userId != null ? !userId.equals(that.userId) : that.userId != null) { + return false; + } + if (messageId != null ? !messageId.equals(that.messageId) : that.messageId != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId != null ? userId.hashCode() : 0; + result = 31 * result + (messageId != null ? messageId.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/UserVisiblePost.java b/src/main/java/eu/mulk/mulkcms2/benki/UserVisiblePost.java new file mode 100644 index 0000000..06862c5 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/UserVisiblePost.java @@ -0,0 +1,62 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "user_visible_posts", schema = "public", catalog = "benki") +public class UserVisiblePost { + + private Integer userId; + private Integer messageId; + + @Basic + @Column(name = "user", nullable = true) + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + @Basic + @Column(name = "message", nullable = true) + public Integer getMessageId() { + return messageId; + } + + public void setMessageId(Integer messageId) { + this.messageId = messageId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + UserVisiblePost that = (UserVisiblePost) o; + + if (userId != null ? !userId.equals(that.userId) : that.userId != null) { + return false; + } + if (messageId != null ? !messageId.equals(that.messageId) : that.messageId != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = userId != null ? userId.hashCode() : 0; + result = 31 * result + (messageId != null ? messageId.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/WebId.java b/src/main/java/eu/mulk/mulkcms2/benki/WebId.java new file mode 100644 index 0000000..a1a1cf2 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/WebId.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "webids", schema = "public", catalog = "benki") +public class WebId { + + private String webid; + private User user; + + @Id + @Column(name = "webid", nullable = false, length = -1) + public String getWebid() { + return webid; + } + + public void setWebid(String webid) { + this.webid = webid; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + WebId webId = (WebId) o; + + if (webid != null ? !webid.equals(webId.webid) : webId.webid != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + return webid != null ? webid.hashCode() : 0; + } + + @ManyToOne + @JoinColumn(name = "user", referencedColumnName = "id", nullable = false) + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/WikiPage.java b/src/main/java/eu/mulk/mulkcms2/benki/WikiPage.java new file mode 100644 index 0000000..4b8c3ad --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/WikiPage.java @@ -0,0 +1,58 @@ +package eu.mulk.mulkcms2.benki; + +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "wiki_pages", schema = "public", catalog = "benki") +public class WikiPage { + + private int id; + private Collection revisions; + + @Id + @Column(name = "id", nullable = false) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + WikiPage wikiPage = (WikiPage) o; + + if (id != wikiPage.id) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + return id; + } + + @OneToMany(mappedBy = "page") + public Collection getRevisions() { + return revisions; + } + + public void setRevisions(Collection revisions) { + this.revisions = revisions; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/WikiPageRevision.java b/src/main/java/eu/mulk/mulkcms2/benki/WikiPageRevision.java new file mode 100644 index 0000000..58bf520 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/WikiPageRevision.java @@ -0,0 +1,132 @@ +package eu.mulk.mulkcms2.benki; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "wiki_page_revisions", schema = "public", catalog = "benki") +public class WikiPageRevision { + + private int id; + private Object date; + private String title; + private String content; + private String format; + private WikiPage page; + private User author; + + @Id + @Column(name = "id", nullable = false) + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + @Basic + @Column(name = "date", nullable = true) + public Object getDate() { + return date; + } + + public void setDate(Object date) { + this.date = date; + } + + @Basic + @Column(name = "title", nullable = true, length = -1) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + @Basic + @Column(name = "content", nullable = true, length = -1) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + @Basic + @Column(name = "format", nullable = true, length = -1) + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + WikiPageRevision that = (WikiPageRevision) o; + + if (id != that.id) { + return false; + } + if (date != null ? !date.equals(that.date) : that.date != null) { + return false; + } + if (title != null ? !title.equals(that.title) : that.title != null) { + return false; + } + if (content != null ? !content.equals(that.content) : that.content != null) { + return false; + } + if (format != null ? !format.equals(that.format) : that.format != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + (date != null ? date.hashCode() : 0); + result = 31 * result + (title != null ? title.hashCode() : 0); + result = 31 * result + (content != null ? content.hashCode() : 0); + result = 31 * result + (format != null ? format.hashCode() : 0); + return result; + } + + @ManyToOne + @JoinColumn(name = "page", referencedColumnName = "id", nullable = false) + public WikiPage getPage() { + return page; + } + + public void setPage(WikiPage page) { + this.page = page; + } + + @ManyToOne + @JoinColumn(name = "author", referencedColumnName = "id") + public User getAuthor() { + return author; + } + + public void setAuthor(User author) { + this.author = author; + } +} -- cgit v1.2.3