From ec7f805fc62265055b36a9802c01826bdf940bc8 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 24 Jan 2020 11:08:34 +0100 Subject: =?UTF-8?q?Move=20CMS-related=20entities=20into=20a=20=E2=80=9Ccms?= =?UTF-8?q?=E2=80=9D=20package.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie350230552fa6f970f26412b40974ca4af7a9260 --- .../eu/mulk/mulkcms2/cms/comments/Comment.java | 32 +++++++++++ .../mulkcms2/cms/comments/CommentRevision.java | 54 ++++++++++++++++++ .../mulkcms2/cms/comments/UsedTransactionKey.java | 16 ++++++ .../java/eu/mulk/mulkcms2/cms/journal/Journal.java | 25 +++++++++ .../eu/mulk/mulkcms2/cms/journal/JournalEntry.java | 39 +++++++++++++ .../mulk/mulkcms2/cms/journal/JournalEntryPK.java | 49 ++++++++++++++++ .../cms/legacyjournal/LegacyJournalCategory.java | 19 +++++++ .../cms/legacyjournal/LegacyJournalComment.java | 50 +++++++++++++++++ .../cms/legacyjournal/LegacyJournalEntry.java | 46 +++++++++++++++ .../cms/legacyjournal/LegacyJournalPingback.java | 41 ++++++++++++++ .../cms/legacyjournal/LegacyJournalTrackback.java | 50 +++++++++++++++++ .../java/eu/mulk/mulkcms2/cms/pages/Article.java | 49 ++++++++++++++++ .../eu/mulk/mulkcms2/cms/pages/ArticleAlias.java | 23 ++++++++ .../mulk/mulkcms2/cms/pages/ArticleBranchTip.java | 24 ++++++++ .../mulkcms2/cms/pages/ArticleBranchTipPK.java | 49 ++++++++++++++++ .../mulkcms2/cms/pages/ArticleCommentCount.java | 21 +++++++ .../mulkcms2/cms/pages/ArticlePublishingDate.java | 22 ++++++++ .../mulk/mulkcms2/cms/pages/ArticleRevision.java | 65 ++++++++++++++++++++++ .../cms/pages/ArticleRevisionCharacteristic.java | 37 ++++++++++++ .../cms/pages/ArticleRevisionCharacteristicPK.java | 46 +++++++++++++++ .../eu/mulk/mulkcms2/cms/pages/ArticleType.java | 28 ++++++++++ .../eu/mulk/mulkcms2/cms/pages/CachedPage.java | 29 ++++++++++ .../eu/mulk/mulkcms2/cms/pages/CachedPagePK.java | 49 ++++++++++++++++ .../java/eu/mulk/mulkcms2/cms/pages/Category.java | 37 ++++++++++++ .../mulk/mulkcms2/cms/users/LoginCertificate.java | 34 +++++++++++ .../mulkcms2/cms/users/LoginCertificatePK.java | 52 +++++++++++++++++ .../java/eu/mulk/mulkcms2/cms/users/OpenId.java | 34 +++++++++++ .../java/eu/mulk/mulkcms2/cms/users/OpenIdPK.java | 49 ++++++++++++++++ .../java/eu/mulk/mulkcms2/cms/users/Password.java | 34 +++++++++++ .../eu/mulk/mulkcms2/cms/users/PasswordPK.java | 49 ++++++++++++++++ src/main/java/eu/mulk/mulkcms2/cms/users/User.java | 54 ++++++++++++++++++ .../eu/mulk/mulkcms2/cms/users/UserPermission.java | 37 ++++++++++++ .../mulk/mulkcms2/cms/users/UserPermissionPK.java | 49 ++++++++++++++++ .../eu/mulk/mulkcms2/cms/users/UserSetting.java | 37 ++++++++++++ .../eu/mulk/mulkcms2/cms/users/UserSettingPK.java | 49 ++++++++++++++++ .../eu/mulk/mulkcms2/cms/web/ExampleResource.java | 14 +++++ .../java/eu/mulk/mulkcms2/comments/Comment.java | 32 ----------- .../eu/mulk/mulkcms2/comments/CommentRevision.java | 54 ------------------ .../mulk/mulkcms2/comments/UsedTransactionKey.java | 16 ------ .../java/eu/mulk/mulkcms2/journal/Journal.java | 25 --------- .../eu/mulk/mulkcms2/journal/JournalEntry.java | 39 ------------- .../eu/mulk/mulkcms2/journal/JournalEntryPK.java | 49 ---------------- .../legacyjournal/LegacyJournalCategory.java | 19 ------- .../legacyjournal/LegacyJournalComment.java | 50 ----------------- .../mulkcms2/legacyjournal/LegacyJournalEntry.java | 46 --------------- .../legacyjournal/LegacyJournalPingback.java | 41 -------------- .../legacyjournal/LegacyJournalTrackback.java | 50 ----------------- src/main/java/eu/mulk/mulkcms2/pages/Article.java | 49 ---------------- .../java/eu/mulk/mulkcms2/pages/ArticleAlias.java | 23 -------- .../eu/mulk/mulkcms2/pages/ArticleBranchTip.java | 24 -------- .../eu/mulk/mulkcms2/pages/ArticleBranchTipPK.java | 49 ---------------- .../mulk/mulkcms2/pages/ArticleCommentCount.java | 21 ------- .../mulk/mulkcms2/pages/ArticlePublishingDate.java | 22 -------- .../eu/mulk/mulkcms2/pages/ArticleRevision.java | 65 ---------------------- .../pages/ArticleRevisionCharacteristic.java | 37 ------------ .../pages/ArticleRevisionCharacteristicPK.java | 46 --------------- .../java/eu/mulk/mulkcms2/pages/ArticleType.java | 28 ---------- .../java/eu/mulk/mulkcms2/pages/CachedPage.java | 29 ---------- .../java/eu/mulk/mulkcms2/pages/CachedPagePK.java | 49 ---------------- src/main/java/eu/mulk/mulkcms2/pages/Category.java | 37 ------------ .../eu/mulk/mulkcms2/users/LoginCertificate.java | 34 ----------- .../eu/mulk/mulkcms2/users/LoginCertificatePK.java | 52 ----------------- src/main/java/eu/mulk/mulkcms2/users/OpenId.java | 34 ----------- src/main/java/eu/mulk/mulkcms2/users/OpenIdPK.java | 49 ---------------- src/main/java/eu/mulk/mulkcms2/users/Password.java | 34 ----------- .../java/eu/mulk/mulkcms2/users/PasswordPK.java | 49 ---------------- src/main/java/eu/mulk/mulkcms2/users/User.java | 54 ------------------ .../eu/mulk/mulkcms2/users/UserPermission.java | 37 ------------ .../eu/mulk/mulkcms2/users/UserPermissionPK.java | 49 ---------------- .../java/eu/mulk/mulkcms2/users/UserSetting.java | 37 ------------ .../java/eu/mulk/mulkcms2/users/UserSettingPK.java | 49 ---------------- .../java/eu/mulk/mulkcms2/web/ExampleResource.java | 14 ----- 72 files changed, 1392 insertions(+), 1392 deletions(-) create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/comments/Comment.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/comments/CommentRevision.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/comments/UsedTransactionKey.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/journal/Journal.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntry.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntryPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalCategory.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalComment.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalEntry.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalPingback.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalTrackback.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/Article.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleAlias.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTip.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTipPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleCommentCount.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticlePublishingDate.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevision.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristic.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristicPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleType.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPage.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPagePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/pages/Category.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificate.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificatePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/OpenId.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/OpenIdPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/Password.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/PasswordPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/User.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/UserPermission.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/UserPermissionPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/UserSetting.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/users/UserSettingPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/cms/web/ExampleResource.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/comments/Comment.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/comments/CommentRevision.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/comments/UsedTransactionKey.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/journal/Journal.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/journal/JournalEntry.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/journal/JournalEntryPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalCategory.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalComment.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalEntry.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalPingback.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalTrackback.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/Article.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleAlias.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTip.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTipPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleCommentCount.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticlePublishingDate.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleRevision.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristic.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristicPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleType.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/CachedPage.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/CachedPagePK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/pages/Category.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/LoginCertificatePK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/OpenId.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/OpenIdPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/Password.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/PasswordPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/User.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserPermission.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserPermissionPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserSetting.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserSettingPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/web/ExampleResource.java (limited to 'src/main/java/eu') diff --git a/src/main/java/eu/mulk/mulkcms2/cms/comments/Comment.java b/src/main/java/eu/mulk/mulkcms2/cms/comments/Comment.java new file mode 100644 index 0000000..4dc8d9d --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/comments/Comment.java @@ -0,0 +1,32 @@ +package eu.mulk.mulkcms2.cms.comments; + +import eu.mulk.mulkcms2.cms.pages.Article; +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "comments", schema = "public", catalog = "mulkcms") +public class Comment extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "global_id", nullable = true, length = -1) + public String globalId; + + @OneToMany(mappedBy = "comment", fetch = FetchType.LAZY) + public Collection revisions; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) + public Article article; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/comments/CommentRevision.java b/src/main/java/eu/mulk/mulkcms2/cms/comments/CommentRevision.java new file mode 100644 index 0000000..effa45d --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/comments/CommentRevision.java @@ -0,0 +1,54 @@ +package eu.mulk.mulkcms2.cms.comments; + +import com.vladmihalcea.hibernate.type.basic.Inet; +import com.vladmihalcea.hibernate.type.basic.PostgreSQLInetType; +import eu.mulk.mulkcms2.cms.users.User; +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.sql.Timestamp; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.TypeDef; + +@Entity +@Table(name = "comment_revisions", schema = "public", catalog = "mulkcms") +@TypeDef(name = "inet", typeClass = PostgreSQLInetType.class, defaultForType = Inet.class) +public class CommentRevision extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "date", nullable = true) + public Timestamp date; + + @Column(name = "content", nullable = false, length = -1) + public String content; + + @Column(name = "format", nullable = false, length = -1) + public String format; + + @Column(name = "status", nullable = false, length = -1) + public String status; + + @Column(name = "article_revision", nullable = true) + public Integer articleRevision; + + @Column(name = "submitter_ip", nullable = true, columnDefinition = "inet") + public Inet submitterIp; + + @Column(name = "submitter_user_agent", nullable = true, length = -1) + public String submitterUserAgent; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "comment", referencedColumnName = "id", nullable = false) + public Comment comment; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "author", referencedColumnName = "id") + public User user; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/comments/UsedTransactionKey.java b/src/main/java/eu/mulk/mulkcms2/cms/comments/UsedTransactionKey.java new file mode 100644 index 0000000..57dd112 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/comments/UsedTransactionKey.java @@ -0,0 +1,16 @@ +package eu.mulk.mulkcms2.cms.comments; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "used_transaction_keys", schema = "public", catalog = "mulkcms") +public class UsedTransactionKey extends PanacheEntityBase { + + @Id + @Column(name = "key", nullable = false) + public long key; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/journal/Journal.java b/src/main/java/eu/mulk/mulkcms2/cms/journal/Journal.java new file mode 100644 index 0000000..b3d8bf5 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/journal/Journal.java @@ -0,0 +1,25 @@ +package eu.mulk.mulkcms2.cms.journal; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "journals", schema = "public", catalog = "mulkcms") +public class Journal extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "path_prefix", nullable = true, length = -1) + public String pathPrefix; + + @OneToMany(mappedBy = "journal", fetch = FetchType.LAZY) + public Collection entries; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntry.java b/src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntry.java new file mode 100644 index 0000000..ed4aeed --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntry.java @@ -0,0 +1,39 @@ +package eu.mulk.mulkcms2.cms.journal; + +import eu.mulk.mulkcms2.cms.pages.Article; +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "journal_entries", schema = "public", catalog = "mulkcms") +@IdClass(JournalEntryPK.class) +public class JournalEntry extends PanacheEntityBase { + + @Id + @Column(name = "journal", nullable = false) + public int journalId; + + @Id + @Column(name = "index", nullable = false) + public int index; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "journal", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false) + public Journal journal; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) + public Article article; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntryPK.java b/src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntryPK.java new file mode 100644 index 0000000..88eb083 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/journal/JournalEntryPK.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.journal; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class JournalEntryPK implements Serializable { + + private int journalId; + private int index; + + @Column(name = "journal", nullable = false) + @Id + public int getJournalId() { + return journalId; + } + + public void setJournalId(int journalId) { + this.journalId = journalId; + } + + @Column(name = "index", nullable = false) + @Id + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JournalEntryPK that = (JournalEntryPK) o; + return journalId == that.journalId && index == that.index; + } + + @Override + public int hashCode() { + return Objects.hash(journalId, index); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalCategory.java b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalCategory.java new file mode 100644 index 0000000..76d7b94 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalCategory.java @@ -0,0 +1,19 @@ +package eu.mulk.mulkcms2.cms.legacyjournal; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "journal_category", schema = "public", catalog = "mulkcms") +public class LegacyJournalCategory extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "uuid", nullable = false, length = 36) + public String uuid; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalComment.java b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalComment.java new file mode 100644 index 0000000..0e28e71 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalComment.java @@ -0,0 +1,50 @@ +package eu.mulk.mulkcms2.cms.legacyjournal; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "journal_comment", schema = "public", catalog = "mulkcms") +public class LegacyJournalComment extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "uuid", nullable = false, length = 36) + public String uuid; + + @Column(name = "date", nullable = false) + public long date; + + @Column(name = "body", nullable = false, length = -1) + public String body; + + @Column(name = "author", nullable = true, length = -1) + public String author; + + @Column(name = "email", nullable = true, length = -1) + public String email; + + @Column(name = "website", nullable = true, length = -1) + public String website; + + @Column(name = "spam_p", nullable = true) + public Boolean spamP; + + @Column(name = "submitter_ip", nullable = false, length = -1) + public String submitterIp; + + @Column(name = "submitter_user_agent", nullable = false, length = -1) + public String submitterUserAgent; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false) + public LegacyJournalEntry journalEntry; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalEntry.java b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalEntry.java new file mode 100644 index 0000000..df2e8cf --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalEntry.java @@ -0,0 +1,46 @@ +package eu.mulk.mulkcms2.cms.legacyjournal; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "journal_entry", schema = "public", catalog = "mulkcms") +public class LegacyJournalEntry extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "uuid", nullable = false, length = 36) + public String uuid; + + @Column(name = "title", nullable = false, length = -1) + public String title; + + @Column(name = "date", nullable = false) + public long date; + + @Column(name = "last_modification", nullable = true) + public Long lastModification; + + @Column(name = "body", nullable = false, length = -1) + public String body; + + @Column(name = "type", nullable = false, length = -1) + public String type; + + @OneToMany(mappedBy = "journalEntry", fetch = FetchType.LAZY) + public Collection comments; + + @OneToMany(mappedBy = "journalEntry", fetch = FetchType.LAZY) + public Collection pingbacks; + + @OneToMany(mappedBy = "journalEntry", fetch = FetchType.LAZY) + public Collection trackbacks; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalPingback.java b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalPingback.java new file mode 100644 index 0000000..5052ee1 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalPingback.java @@ -0,0 +1,41 @@ +package eu.mulk.mulkcms2.cms.legacyjournal; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "journal_pingback", schema = "public", catalog = "mulkcms") +public class LegacyJournalPingback extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "uuid", nullable = false, length = 36) + public String uuid; + + @Column(name = "date", nullable = false) + public long date; + + @Column(name = "url", nullable = true, length = -1) + public String url; + + @Column(name = "spam_p", nullable = true) + public Boolean spamP; + + @Column(name = "submitter_ip", nullable = false, length = -1) + public String submitterIp; + + @Column(name = "submitter_user_agent", nullable = false, length = -1) + public String submitterUserAgent; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false) + public LegacyJournalEntry journalEntry; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalTrackback.java b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalTrackback.java new file mode 100644 index 0000000..daf4c2d --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/legacyjournal/LegacyJournalTrackback.java @@ -0,0 +1,50 @@ +package eu.mulk.mulkcms2.cms.legacyjournal; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "journal_trackback", schema = "public", catalog = "mulkcms") +public class LegacyJournalTrackback extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "uuid", nullable = false, length = 36) + public String uuid; + + @Column(name = "date", nullable = false) + public long date; + + @Column(name = "excerpt", nullable = false, length = -1) + public String excerpt; + + @Column(name = "title", nullable = true, length = -1) + public String title; + + @Column(name = "blog_name", nullable = true, length = -1) + public String blogName; + + @Column(name = "url", nullable = true, length = -1) + public String url; + + @Column(name = "spam_p", nullable = true) + public Boolean spamP; + + @Column(name = "submitter_ip", nullable = false, length = -1) + public String submitterIp; + + @Column(name = "submitter_user_agent", nullable = false, length = -1) + public String submitterUserAgent; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false) + public LegacyJournalEntry journalEntry; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/Article.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/Article.java new file mode 100644 index 0000000..5110558 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/Article.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.pages; + +import eu.mulk.mulkcms2.cms.comments.Comment; +import eu.mulk.mulkcms2.cms.journal.JournalEntry; +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.util.Collection; +import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "articles", schema = "public", catalog = "mulkcms") +public class Article extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) + public Collection aliases; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable( + name = "article_category_memberships", + joinColumns = @JoinColumn(name = "article"), + inverseJoinColumns = @JoinColumn(name = "category")) + public Set categories; + + @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) + public Collection revisions; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "type", referencedColumnName = "id", nullable = false) + public ArticleType type; + + @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) + public Collection comments; + + @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) + public Collection journalEntries; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleAlias.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleAlias.java new file mode 100644 index 0000000..de8d443 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleAlias.java @@ -0,0 +1,23 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "article_aliases", schema = "public", catalog = "mulkcms") +public class ArticleAlias extends PanacheEntityBase { + + @Id + @Column(name = "alias", nullable = false, length = -1) + public String alias; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) + public Article article; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTip.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTip.java new file mode 100644 index 0000000..0417b7d --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTip.java @@ -0,0 +1,24 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +@Entity +@Table(name = "article_branch_tips", schema = "public", catalog = "mulkcms") +@IdClass(ArticleBranchTipPK.class) +@Immutable +public class ArticleBranchTip extends PanacheEntityBase { + + @Column(name = "article", nullable = true) + @Id + private Integer articleId; + + @Column(name = "revision", nullable = true) + @Id + private Integer revisionId; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTipPK.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTipPK.java new file mode 100644 index 0000000..2d93b54 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleBranchTipPK.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.pages; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class ArticleBranchTipPK implements Serializable { + + private int articleId; + private int revisionId; + + @Id + @Column(name = "article", nullable = false) + public int getArticleId() { + return articleId; + } + + @Id + @Column(name = "revision", nullable = false) + public int getRevisionId() { + return revisionId; + } + + public void setArticleId(int articleId) { + this.articleId = articleId; + } + + public void setRevisionId(int revisionId) { + this.revisionId = revisionId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof ArticleBranchTipPK)) { + return false; + } + ArticleBranchTipPK that = (ArticleBranchTipPK) o; + return articleId == that.articleId && revisionId == that.revisionId; + } + + @Override + public int hashCode() { + return Objects.hash(articleId, revisionId); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleCommentCount.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleCommentCount.java new file mode 100644 index 0000000..a476188 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleCommentCount.java @@ -0,0 +1,21 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +@Entity +@Table(name = "article_comment_counts", schema = "public", catalog = "mulkcms") +@Immutable +public class ArticleCommentCount extends PanacheEntityBase { + + @Column(name = "article", nullable = true) + @Id + public Integer article; + + @Column(name = "comment_count", nullable = true) + public Long commentCount; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticlePublishingDate.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticlePublishingDate.java new file mode 100644 index 0000000..22abf59 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticlePublishingDate.java @@ -0,0 +1,22 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.sql.Timestamp; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Immutable; + +@Entity +@Table(name = "article_publishing_dates", schema = "public", catalog = "mulkcms") +@Immutable +public class ArticlePublishingDate extends PanacheEntityBase { + + @Column(name = "article", nullable = true) + @Id + public Integer article; + + @Column(name = "publishing_date", nullable = true) + public Timestamp publishingDate; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevision.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevision.java new file mode 100644 index 0000000..ebb2b9e --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevision.java @@ -0,0 +1,65 @@ +package eu.mulk.mulkcms2.cms.pages; + +import eu.mulk.mulkcms2.cms.users.User; +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.sql.Timestamp; +import java.util.Collection; +import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "article_revisions", schema = "public", catalog = "mulkcms") +public class ArticleRevision extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "date", nullable = true) + public Timestamp date; + + @Column(name = "title", nullable = false, length = -1) + public String title; + + @Column(name = "content", nullable = false, length = -1) + public String content; + + @Column(name = "format", nullable = false, length = -1) + public String format; + + @Column(name = "status", nullable = false, length = -1) + public String status; + + @Column(name = "global_id", nullable = true, length = -1) + public String globalId; + + @OneToMany(mappedBy = "articleRevision", fetch = FetchType.LAZY) + public Collection characteristics; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable( + name = "article_revision_parenthood", + joinColumns = @JoinColumn(name = "parent"), + inverseJoinColumns = @JoinColumn(name = "child")) + public Set children; + + @ManyToMany(mappedBy = "children") + public Set parents; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) + public Article article; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "author", referencedColumnName = "id") + public User authors; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristic.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristic.java new file mode 100644 index 0000000..eed2fb6 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristic.java @@ -0,0 +1,37 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "article_revision_characteristics", schema = "public", catalog = "mulkcms") +@IdClass(ArticleRevisionCharacteristicPK.class) +public class ArticleRevisionCharacteristic extends PanacheEntityBase { + + @Column(name = "characteristic", nullable = false, length = -1) + @Id + public String characteristic; + + @Id + @Column(name = "revision", nullable = false) + public int articleRevisionId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "revision", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false) + public ArticleRevision articleRevision; + + @Column(name = "value", nullable = true, length = -1) + public String value; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristicPK.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristicPK.java new file mode 100644 index 0000000..7f9b61a --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleRevisionCharacteristicPK.java @@ -0,0 +1,46 @@ +package eu.mulk.mulkcms2.cms.pages; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Id; + +public class ArticleRevisionCharacteristicPK implements Serializable { + private String characteristic; + private int articleRevisionId; + + @Id + public String getCharacteristic() { + return characteristic; + } + + public void setCharacteristic(String characteristic) { + this.characteristic = characteristic; + } + + @Id + public int getArticleRevisionId() { + return articleRevisionId; + } + + public void setArticleRevisionId(int articleRevisionId) { + this.articleRevisionId = articleRevisionId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof ArticleRevisionCharacteristicPK)) { + return false; + } + ArticleRevisionCharacteristicPK that = (ArticleRevisionCharacteristicPK) o; + return articleRevisionId == that.articleRevisionId + && Objects.equals(characteristic, that.characteristic); + } + + @Override + public int hashCode() { + return Objects.hash(characteristic, articleRevisionId); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleType.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleType.java new file mode 100644 index 0000000..7233b92 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/ArticleType.java @@ -0,0 +1,28 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "article_types", schema = "public", catalog = "mulkcms") +public class ArticleType extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "name", nullable = true, length = -1) + public String name; + + @Column(name = "page_template", nullable = true, length = -1) + public String pageTemplate; + + @OneToMany(mappedBy = "type", fetch = FetchType.LAZY) + public Collection
articles; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPage.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPage.java new file mode 100644 index 0000000..4217053 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPage.java @@ -0,0 +1,29 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.sql.Timestamp; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; + +@Entity +@Table(name = "cached_pages", schema = "public", catalog = "mulkcms") +@IdClass(CachedPagePK.class) +public class CachedPage extends PanacheEntityBase { + + @Id + @Column(name = "alias", nullable = false, length = -1) + public String alias; + + @Id + @Column(name = "characteristic_hash", nullable = false) + public int characteristicHash; + + @Column(name = "date", nullable = false) + public Timestamp date; + + @Column(name = "content", nullable = false, length = -1) + public String content; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPagePK.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPagePK.java new file mode 100644 index 0000000..1a72aea --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/CachedPagePK.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.pages; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class CachedPagePK implements Serializable { + + private String alias; + private int characteristicHash; + + @Column(name = "alias", nullable = false, length = -1) + @Id + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } + + @Column(name = "characteristic_hash", nullable = false) + @Id + public int getCharacteristicHash() { + return characteristicHash; + } + + public void setCharacteristicHash(int characteristicHash) { + this.characteristicHash = characteristicHash; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CachedPagePK that = (CachedPagePK) o; + return characteristicHash == that.characteristicHash && Objects.equals(alias, that.alias); + } + + @Override + public int hashCode() { + return Objects.hash(alias, characteristicHash); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/pages/Category.java b/src/main/java/eu/mulk/mulkcms2/cms/pages/Category.java new file mode 100644 index 0000000..5171453 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/pages/Category.java @@ -0,0 +1,37 @@ +package eu.mulk.mulkcms2.cms.pages; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "categories", schema = "public", catalog = "mulkcms") +public class Category extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "name", nullable = false, length = -1) + public String name; + + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable( + name = "category_inclusions", + joinColumns = @JoinColumn(name = "category"), + inverseJoinColumns = @JoinColumn(name = "supercategory")) + public Set supercategories; + + @ManyToMany(mappedBy = "supercategories", fetch = FetchType.LAZY) + public Set subcategories; + + @ManyToMany(fetch = FetchType.LAZY, mappedBy = "categories") + public Set
articles; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificate.java b/src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificate.java new file mode 100644 index 0000000..4e6f047 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificate.java @@ -0,0 +1,34 @@ +package eu.mulk.mulkcms2.cms.users; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "login_certificates", schema = "public", catalog = "mulkcms") +@IdClass(LoginCertificatePK.class) +public class LoginCertificate extends PanacheEntityBase { + + @Id + @Column(name = "user", nullable = false) + public int userId; + + @Id + @Column(name = "certificate", nullable = false) + public byte[] certificate; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "user", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false) + public User user; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificatePK.java b/src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificatePK.java new file mode 100644 index 0000000..8bb5f44 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/LoginCertificatePK.java @@ -0,0 +1,52 @@ +package eu.mulk.mulkcms2.cms.users; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class LoginCertificatePK implements Serializable { + + private int userId; + private byte[] certificate; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "certificate", nullable = false) + @Id + public byte[] getCertificate() { + return certificate; + } + + public void setCertificate(byte[] certificate) { + this.certificate = certificate; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginCertificatePK that = (LoginCertificatePK) o; + return userId == that.userId && Arrays.equals(certificate, that.certificate); + } + + @Override + public int hashCode() { + int result = Objects.hash(userId); + result = 31 * result + Arrays.hashCode(certificate); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/OpenId.java b/src/main/java/eu/mulk/mulkcms2/cms/users/OpenId.java new file mode 100644 index 0000000..0cc7407 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/OpenId.java @@ -0,0 +1,34 @@ +package eu.mulk.mulkcms2.cms.users; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "openids", schema = "public", catalog = "mulkcms") +@IdClass(OpenIdPK.class) +public class OpenId extends PanacheEntityBase { + + @Id + @Column(name = "user", nullable = false) + public int userId; + + @Id + @Column(name = "openid", nullable = false, length = -1) + public String openid; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "user", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false) + public User user; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/OpenIdPK.java b/src/main/java/eu/mulk/mulkcms2/cms/users/OpenIdPK.java new file mode 100644 index 0000000..e80fb25 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/OpenIdPK.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.users; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class OpenIdPK implements Serializable { + + private int userId; + private String openid; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "openid", nullable = false, length = -1) + @Id + 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; + } + OpenIdPK openIdPK = (OpenIdPK) o; + return userId == openIdPK.userId && Objects.equals(openid, openIdPK.openid); + } + + @Override + public int hashCode() { + return Objects.hash(userId, openid); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/Password.java b/src/main/java/eu/mulk/mulkcms2/cms/users/Password.java new file mode 100644 index 0000000..632284e --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/Password.java @@ -0,0 +1,34 @@ +package eu.mulk.mulkcms2.cms.users; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "passwords", schema = "public", catalog = "mulkcms") +@IdClass(PasswordPK.class) +public class Password extends PanacheEntityBase { + + @Id + @Column(name = "user", nullable = false) + public int userId; + + @Id + @Column(name = "password", nullable = false, length = -1) + public String password; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "user", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false) + public User user; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/PasswordPK.java b/src/main/java/eu/mulk/mulkcms2/cms/users/PasswordPK.java new file mode 100644 index 0000000..c43cd5e --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/PasswordPK.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.users; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class PasswordPK implements Serializable { + + private int userId; + private String password; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "password", nullable = false, length = -1) + @Id + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordPK that = (PasswordPK) o; + return userId == that.userId && Objects.equals(password, that.password); + } + + @Override + public int hashCode() { + return Objects.hash(userId, password); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/User.java b/src/main/java/eu/mulk/mulkcms2/cms/users/User.java new file mode 100644 index 0000000..a84462f --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/User.java @@ -0,0 +1,54 @@ +package eu.mulk.mulkcms2.cms.users; + +import eu.mulk.mulkcms2.cms.comments.CommentRevision; +import eu.mulk.mulkcms2.cms.pages.ArticleRevision; +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "users", schema = "public", catalog = "mulkcms") +public class User extends PanacheEntityBase { + + @Id + @Column(name = "id", nullable = false) + public int id; + + @Column(name = "name", nullable = true, length = -1) + public String name; + + @Column(name = "status", nullable = false, length = -1) + public String status; + + @Column(name = "email", nullable = true, length = -1) + public String email; + + @Column(name = "website", nullable = true, length = -1) + public String website; + + @OneToMany(mappedBy = "authors", fetch = FetchType.LAZY) + public Collection articleRevisions; + + @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) + public Collection commentRevisions; + + @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) + public Collection loginCertificates; + + @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) + public Collection openids; + + @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) + public Collection passwords; + + @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) + public Collection userPermissions; + + @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) + public Collection userSettings; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/UserPermission.java b/src/main/java/eu/mulk/mulkcms2/cms/users/UserPermission.java new file mode 100644 index 0000000..a580813 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/UserPermission.java @@ -0,0 +1,37 @@ +package eu.mulk.mulkcms2.cms.users; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_permissions", schema = "public", catalog = "mulkcms") +@IdClass(UserPermissionPK.class) +public class UserPermission extends PanacheEntityBase { + + @Id + @Column(name = "user", nullable = false) + public int userId; + + @Id + @Column(name = "permission", nullable = false, length = -1) + public String permission; + + @Column(name = "status", nullable = true) + public Boolean status; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "user", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false) + public User user; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/UserPermissionPK.java b/src/main/java/eu/mulk/mulkcms2/cms/users/UserPermissionPK.java new file mode 100644 index 0000000..406178e --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/UserPermissionPK.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.users; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class UserPermissionPK implements Serializable { + + private int userId; + private String permission; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "permission", nullable = false, length = -1) + @Id + public String getPermission() { + return permission; + } + + public void setPermission(String permission) { + this.permission = permission; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserPermissionPK that = (UserPermissionPK) o; + return userId == that.userId && Objects.equals(permission, that.permission); + } + + @Override + public int hashCode() { + return Objects.hash(userId, permission); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/UserSetting.java b/src/main/java/eu/mulk/mulkcms2/cms/users/UserSetting.java new file mode 100644 index 0000000..f4ec234 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/UserSetting.java @@ -0,0 +1,37 @@ +package eu.mulk.mulkcms2.cms.users; + +import io.quarkus.hibernate.orm.panache.PanacheEntityBase; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "user_settings", schema = "public", catalog = "mulkcms") +@IdClass(UserSettingPK.class) +public class UserSetting extends PanacheEntityBase { + + @Id + @Column(name = "user", nullable = false) + public int userId; + + @Id + @Column(name = "setting", nullable = false, length = -1) + public String setting; + + @Column(name = "value", nullable = true, length = -1) + public String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "user", + referencedColumnName = "id", + nullable = false, + insertable = false, + updatable = false) + public User user; +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/users/UserSettingPK.java b/src/main/java/eu/mulk/mulkcms2/cms/users/UserSettingPK.java new file mode 100644 index 0000000..b7c28ea --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/users/UserSettingPK.java @@ -0,0 +1,49 @@ +package eu.mulk.mulkcms2.cms.users; + +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Id; + +public class UserSettingPK implements Serializable { + + private int userId; + private String setting; + + @Column(name = "user", nullable = false) + @Id + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + @Column(name = "setting", nullable = false, length = -1) + @Id + public String getSetting() { + return setting; + } + + public void setSetting(String setting) { + this.setting = setting; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserSettingPK that = (UserSettingPK) o; + return userId == that.userId && Objects.equals(setting, that.setting); + } + + @Override + public int hashCode() { + return Objects.hash(userId, setting); + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/cms/web/ExampleResource.java b/src/main/java/eu/mulk/mulkcms2/cms/web/ExampleResource.java new file mode 100644 index 0000000..fc504c8 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/cms/web/ExampleResource.java @@ -0,0 +1,14 @@ +package eu.mulk.mulkcms2.cms.web; + +import javax.ws.rs.GET; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +public class ExampleResource { + + @GET + @Produces({MediaType.TEXT_PLAIN}) + public String hello() { + return "hello!"; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/comments/Comment.java b/src/main/java/eu/mulk/mulkcms2/comments/Comment.java deleted file mode 100644 index d14fef6..0000000 --- a/src/main/java/eu/mulk/mulkcms2/comments/Comment.java +++ /dev/null @@ -1,32 +0,0 @@ -package eu.mulk.mulkcms2.comments; - -import eu.mulk.mulkcms2.pages.Article; -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.util.Collection; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "comments", schema = "public", catalog = "mulkcms") -public class Comment extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "global_id", nullable = true, length = -1) - public String globalId; - - @OneToMany(mappedBy = "comment", fetch = FetchType.LAZY) - public Collection revisions; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) - public Article article; -} diff --git a/src/main/java/eu/mulk/mulkcms2/comments/CommentRevision.java b/src/main/java/eu/mulk/mulkcms2/comments/CommentRevision.java deleted file mode 100644 index 9d543b9..0000000 --- a/src/main/java/eu/mulk/mulkcms2/comments/CommentRevision.java +++ /dev/null @@ -1,54 +0,0 @@ -package eu.mulk.mulkcms2.comments; - -import com.vladmihalcea.hibernate.type.basic.Inet; -import com.vladmihalcea.hibernate.type.basic.PostgreSQLInetType; -import eu.mulk.mulkcms2.users.User; -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.sql.Timestamp; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import org.hibernate.annotations.TypeDef; - -@Entity -@Table(name = "comment_revisions", schema = "public", catalog = "mulkcms") -@TypeDef(name = "inet", typeClass = PostgreSQLInetType.class, defaultForType = Inet.class) -public class CommentRevision extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "date", nullable = true) - public Timestamp date; - - @Column(name = "content", nullable = false, length = -1) - public String content; - - @Column(name = "format", nullable = false, length = -1) - public String format; - - @Column(name = "status", nullable = false, length = -1) - public String status; - - @Column(name = "article_revision", nullable = true) - public Integer articleRevision; - - @Column(name = "submitter_ip", nullable = true, columnDefinition = "inet") - public Inet submitterIp; - - @Column(name = "submitter_user_agent", nullable = true, length = -1) - public String submitterUserAgent; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "comment", referencedColumnName = "id", nullable = false) - public Comment comment; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "author", referencedColumnName = "id") - public User user; -} diff --git a/src/main/java/eu/mulk/mulkcms2/comments/UsedTransactionKey.java b/src/main/java/eu/mulk/mulkcms2/comments/UsedTransactionKey.java deleted file mode 100644 index 133ce5a..0000000 --- a/src/main/java/eu/mulk/mulkcms2/comments/UsedTransactionKey.java +++ /dev/null @@ -1,16 +0,0 @@ -package eu.mulk.mulkcms2.comments; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "used_transaction_keys", schema = "public", catalog = "mulkcms") -public class UsedTransactionKey extends PanacheEntityBase { - - @Id - @Column(name = "key", nullable = false) - public long key; -} diff --git a/src/main/java/eu/mulk/mulkcms2/journal/Journal.java b/src/main/java/eu/mulk/mulkcms2/journal/Journal.java deleted file mode 100644 index 44fe2a4..0000000 --- a/src/main/java/eu/mulk/mulkcms2/journal/Journal.java +++ /dev/null @@ -1,25 +0,0 @@ -package eu.mulk.mulkcms2.journal; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.util.Collection; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "journals", schema = "public", catalog = "mulkcms") -public class Journal extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "path_prefix", nullable = true, length = -1) - public String pathPrefix; - - @OneToMany(mappedBy = "journal", fetch = FetchType.LAZY) - public Collection entries; -} diff --git a/src/main/java/eu/mulk/mulkcms2/journal/JournalEntry.java b/src/main/java/eu/mulk/mulkcms2/journal/JournalEntry.java deleted file mode 100644 index bc54845..0000000 --- a/src/main/java/eu/mulk/mulkcms2/journal/JournalEntry.java +++ /dev/null @@ -1,39 +0,0 @@ -package eu.mulk.mulkcms2.journal; - -import eu.mulk.mulkcms2.pages.Article; -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "journal_entries", schema = "public", catalog = "mulkcms") -@IdClass(JournalEntryPK.class) -public class JournalEntry extends PanacheEntityBase { - - @Id - @Column(name = "journal", nullable = false) - public int journalId; - - @Id - @Column(name = "index", nullable = false) - public int index; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn( - name = "journal", - referencedColumnName = "id", - nullable = false, - insertable = false, - updatable = false) - public Journal journal; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) - public Article article; -} diff --git a/src/main/java/eu/mulk/mulkcms2/journal/JournalEntryPK.java b/src/main/java/eu/mulk/mulkcms2/journal/JournalEntryPK.java deleted file mode 100644 index 1c9d063..0000000 --- a/src/main/java/eu/mulk/mulkcms2/journal/JournalEntryPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.journal; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class JournalEntryPK implements Serializable { - - private int journalId; - private int index; - - @Column(name = "journal", nullable = false) - @Id - public int getJournalId() { - return journalId; - } - - public void setJournalId(int journalId) { - this.journalId = journalId; - } - - @Column(name = "index", nullable = false) - @Id - public int getIndex() { - return index; - } - - public void setIndex(int index) { - this.index = index; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - JournalEntryPK that = (JournalEntryPK) o; - return journalId == that.journalId && index == that.index; - } - - @Override - public int hashCode() { - return Objects.hash(journalId, index); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalCategory.java b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalCategory.java deleted file mode 100644 index 0e6108e..0000000 --- a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalCategory.java +++ /dev/null @@ -1,19 +0,0 @@ -package eu.mulk.mulkcms2.legacyjournal; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "journal_category", schema = "public", catalog = "mulkcms") -public class LegacyJournalCategory extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "uuid", nullable = false, length = 36) - public String uuid; -} diff --git a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalComment.java b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalComment.java deleted file mode 100644 index eecc1e6..0000000 --- a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalComment.java +++ /dev/null @@ -1,50 +0,0 @@ -package eu.mulk.mulkcms2.legacyjournal; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "journal_comment", schema = "public", catalog = "mulkcms") -public class LegacyJournalComment extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "uuid", nullable = false, length = 36) - public String uuid; - - @Column(name = "date", nullable = false) - public long date; - - @Column(name = "body", nullable = false, length = -1) - public String body; - - @Column(name = "author", nullable = true, length = -1) - public String author; - - @Column(name = "email", nullable = true, length = -1) - public String email; - - @Column(name = "website", nullable = true, length = -1) - public String website; - - @Column(name = "spam_p", nullable = true) - public Boolean spamP; - - @Column(name = "submitter_ip", nullable = false, length = -1) - public String submitterIp; - - @Column(name = "submitter_user_agent", nullable = false, length = -1) - public String submitterUserAgent; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false) - public LegacyJournalEntry journalEntry; -} diff --git a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalEntry.java b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalEntry.java deleted file mode 100644 index f736357..0000000 --- a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalEntry.java +++ /dev/null @@ -1,46 +0,0 @@ -package eu.mulk.mulkcms2.legacyjournal; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.util.Collection; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "journal_entry", schema = "public", catalog = "mulkcms") -public class LegacyJournalEntry extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "uuid", nullable = false, length = 36) - public String uuid; - - @Column(name = "title", nullable = false, length = -1) - public String title; - - @Column(name = "date", nullable = false) - public long date; - - @Column(name = "last_modification", nullable = true) - public Long lastModification; - - @Column(name = "body", nullable = false, length = -1) - public String body; - - @Column(name = "type", nullable = false, length = -1) - public String type; - - @OneToMany(mappedBy = "journalEntry", fetch = FetchType.LAZY) - public Collection comments; - - @OneToMany(mappedBy = "journalEntry", fetch = FetchType.LAZY) - public Collection pingbacks; - - @OneToMany(mappedBy = "journalEntry", fetch = FetchType.LAZY) - public Collection trackbacks; -} diff --git a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalPingback.java b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalPingback.java deleted file mode 100644 index f32ae07..0000000 --- a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalPingback.java +++ /dev/null @@ -1,41 +0,0 @@ -package eu.mulk.mulkcms2.legacyjournal; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "journal_pingback", schema = "public", catalog = "mulkcms") -public class LegacyJournalPingback extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "uuid", nullable = false, length = 36) - public String uuid; - - @Column(name = "date", nullable = false) - public long date; - - @Column(name = "url", nullable = true, length = -1) - public String url; - - @Column(name = "spam_p", nullable = true) - public Boolean spamP; - - @Column(name = "submitter_ip", nullable = false, length = -1) - public String submitterIp; - - @Column(name = "submitter_user_agent", nullable = false, length = -1) - public String submitterUserAgent; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false) - public LegacyJournalEntry journalEntry; -} diff --git a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalTrackback.java b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalTrackback.java deleted file mode 100644 index 4329965..0000000 --- a/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalTrackback.java +++ /dev/null @@ -1,50 +0,0 @@ -package eu.mulk.mulkcms2.legacyjournal; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "journal_trackback", schema = "public", catalog = "mulkcms") -public class LegacyJournalTrackback extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "uuid", nullable = false, length = 36) - public String uuid; - - @Column(name = "date", nullable = false) - public long date; - - @Column(name = "excerpt", nullable = false, length = -1) - public String excerpt; - - @Column(name = "title", nullable = true, length = -1) - public String title; - - @Column(name = "blog_name", nullable = true, length = -1) - public String blogName; - - @Column(name = "url", nullable = true, length = -1) - public String url; - - @Column(name = "spam_p", nullable = true) - public Boolean spamP; - - @Column(name = "submitter_ip", nullable = false, length = -1) - public String submitterIp; - - @Column(name = "submitter_user_agent", nullable = false, length = -1) - public String submitterUserAgent; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "entry_id", referencedColumnName = "id", nullable = false) - public LegacyJournalEntry journalEntry; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/Article.java b/src/main/java/eu/mulk/mulkcms2/pages/Article.java deleted file mode 100644 index 7f83a12..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/Article.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import eu.mulk.mulkcms2.comments.Comment; -import eu.mulk.mulkcms2.journal.JournalEntry; -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.util.Collection; -import java.util.Set; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "articles", schema = "public", catalog = "mulkcms") -public class Article extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) - public Collection aliases; - - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable( - name = "article_category_memberships", - joinColumns = @JoinColumn(name = "article"), - inverseJoinColumns = @JoinColumn(name = "category")) - public Set categories; - - @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) - public Collection revisions; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "type", referencedColumnName = "id", nullable = false) - public ArticleType type; - - @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) - public Collection comments; - - @OneToMany(mappedBy = "article", fetch = FetchType.LAZY) - public Collection journalEntries; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleAlias.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleAlias.java deleted file mode 100644 index d983eac..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleAlias.java +++ /dev/null @@ -1,23 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "article_aliases", schema = "public", catalog = "mulkcms") -public class ArticleAlias extends PanacheEntityBase { - - @Id - @Column(name = "alias", nullable = false, length = -1) - public String alias; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) - public Article article; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTip.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTip.java deleted file mode 100644 index f7d5404..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTip.java +++ /dev/null @@ -1,24 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.Table; -import org.hibernate.annotations.Immutable; - -@Entity -@Table(name = "article_branch_tips", schema = "public", catalog = "mulkcms") -@IdClass(ArticleBranchTipPK.class) -@Immutable -public class ArticleBranchTip extends PanacheEntityBase { - - @Column(name = "article", nullable = true) - @Id - private Integer articleId; - - @Column(name = "revision", nullable = true) - @Id - private Integer revisionId; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTipPK.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTipPK.java deleted file mode 100644 index 2bb6039..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTipPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class ArticleBranchTipPK implements Serializable { - - private int articleId; - private int revisionId; - - @Id - @Column(name = "article", nullable = false) - public int getArticleId() { - return articleId; - } - - @Id - @Column(name = "revision", nullable = false) - public int getRevisionId() { - return revisionId; - } - - public void setArticleId(int articleId) { - this.articleId = articleId; - } - - public void setRevisionId(int revisionId) { - this.revisionId = revisionId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof ArticleBranchTipPK)) { - return false; - } - ArticleBranchTipPK that = (ArticleBranchTipPK) o; - return articleId == that.articleId && revisionId == that.revisionId; - } - - @Override - public int hashCode() { - return Objects.hash(articleId, revisionId); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleCommentCount.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleCommentCount.java deleted file mode 100644 index 612f26c..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleCommentCount.java +++ /dev/null @@ -1,21 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; -import org.hibernate.annotations.Immutable; - -@Entity -@Table(name = "article_comment_counts", schema = "public", catalog = "mulkcms") -@Immutable -public class ArticleCommentCount extends PanacheEntityBase { - - @Column(name = "article", nullable = true) - @Id - public Integer article; - - @Column(name = "comment_count", nullable = true) - public Long commentCount; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticlePublishingDate.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticlePublishingDate.java deleted file mode 100644 index 8f3c7d1..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticlePublishingDate.java +++ /dev/null @@ -1,22 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.sql.Timestamp; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; -import org.hibernate.annotations.Immutable; - -@Entity -@Table(name = "article_publishing_dates", schema = "public", catalog = "mulkcms") -@Immutable -public class ArticlePublishingDate extends PanacheEntityBase { - - @Column(name = "article", nullable = true) - @Id - public Integer article; - - @Column(name = "publishing_date", nullable = true) - public Timestamp publishingDate; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevision.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevision.java deleted file mode 100644 index 9d1f95b..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevision.java +++ /dev/null @@ -1,65 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import eu.mulk.mulkcms2.users.User; -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.sql.Timestamp; -import java.util.Collection; -import java.util.Set; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "article_revisions", schema = "public", catalog = "mulkcms") -public class ArticleRevision extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "date", nullable = true) - public Timestamp date; - - @Column(name = "title", nullable = false, length = -1) - public String title; - - @Column(name = "content", nullable = false, length = -1) - public String content; - - @Column(name = "format", nullable = false, length = -1) - public String format; - - @Column(name = "status", nullable = false, length = -1) - public String status; - - @Column(name = "global_id", nullable = true, length = -1) - public String globalId; - - @OneToMany(mappedBy = "articleRevision", fetch = FetchType.LAZY) - public Collection characteristics; - - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable( - name = "article_revision_parenthood", - joinColumns = @JoinColumn(name = "parent"), - inverseJoinColumns = @JoinColumn(name = "child")) - public Set children; - - @ManyToMany(mappedBy = "children") - public Set parents; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) - public Article article; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "author", referencedColumnName = "id") - public User authors; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristic.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristic.java deleted file mode 100644 index d6a0a67..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristic.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "article_revision_characteristics", schema = "public", catalog = "mulkcms") -@IdClass(ArticleRevisionCharacteristicPK.class) -public class ArticleRevisionCharacteristic extends PanacheEntityBase { - - @Column(name = "characteristic", nullable = false, length = -1) - @Id - public String characteristic; - - @Id - @Column(name = "revision", nullable = false) - public int articleRevisionId; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn( - name = "revision", - referencedColumnName = "id", - nullable = false, - insertable = false, - updatable = false) - public ArticleRevision articleRevision; - - @Column(name = "value", nullable = true, length = -1) - public String value; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristicPK.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristicPK.java deleted file mode 100644 index 9423ee4..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristicPK.java +++ /dev/null @@ -1,46 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Id; - -public class ArticleRevisionCharacteristicPK implements Serializable { - private String characteristic; - private int articleRevisionId; - - @Id - public String getCharacteristic() { - return characteristic; - } - - public void setCharacteristic(String characteristic) { - this.characteristic = characteristic; - } - - @Id - public int getArticleRevisionId() { - return articleRevisionId; - } - - public void setArticleRevisionId(int articleRevisionId) { - this.articleRevisionId = articleRevisionId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof ArticleRevisionCharacteristicPK)) { - return false; - } - ArticleRevisionCharacteristicPK that = (ArticleRevisionCharacteristicPK) o; - return articleRevisionId == that.articleRevisionId - && Objects.equals(characteristic, that.characteristic); - } - - @Override - public int hashCode() { - return Objects.hash(characteristic, articleRevisionId); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/ArticleType.java b/src/main/java/eu/mulk/mulkcms2/pages/ArticleType.java deleted file mode 100644 index 2f0eccb..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/ArticleType.java +++ /dev/null @@ -1,28 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.util.Collection; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "article_types", schema = "public", catalog = "mulkcms") -public class ArticleType extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "name", nullable = true, length = -1) - public String name; - - @Column(name = "page_template", nullable = true, length = -1) - public String pageTemplate; - - @OneToMany(mappedBy = "type", fetch = FetchType.LAZY) - public Collection
articles; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/CachedPage.java b/src/main/java/eu/mulk/mulkcms2/pages/CachedPage.java deleted file mode 100644 index 7723588..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/CachedPage.java +++ /dev/null @@ -1,29 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.sql.Timestamp; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.Table; - -@Entity -@Table(name = "cached_pages", schema = "public", catalog = "mulkcms") -@IdClass(CachedPagePK.class) -public class CachedPage extends PanacheEntityBase { - - @Id - @Column(name = "alias", nullable = false, length = -1) - public String alias; - - @Id - @Column(name = "characteristic_hash", nullable = false) - public int characteristicHash; - - @Column(name = "date", nullable = false) - public Timestamp date; - - @Column(name = "content", nullable = false, length = -1) - public String content; -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/CachedPagePK.java b/src/main/java/eu/mulk/mulkcms2/pages/CachedPagePK.java deleted file mode 100644 index e3fc089..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/CachedPagePK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class CachedPagePK implements Serializable { - - private String alias; - private int characteristicHash; - - @Column(name = "alias", nullable = false, length = -1) - @Id - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - @Column(name = "characteristic_hash", nullable = false) - @Id - public int getCharacteristicHash() { - return characteristicHash; - } - - public void setCharacteristicHash(int characteristicHash) { - this.characteristicHash = characteristicHash; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CachedPagePK that = (CachedPagePK) o; - return characteristicHash == that.characteristicHash && Objects.equals(alias, that.alias); - } - - @Override - public int hashCode() { - return Objects.hash(alias, characteristicHash); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/pages/Category.java b/src/main/java/eu/mulk/mulkcms2/pages/Category.java deleted file mode 100644 index 31a9db7..0000000 --- a/src/main/java/eu/mulk/mulkcms2/pages/Category.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.mulk.mulkcms2.pages; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.util.Set; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "categories", schema = "public", catalog = "mulkcms") -public class Category extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "name", nullable = false, length = -1) - public String name; - - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable( - name = "category_inclusions", - joinColumns = @JoinColumn(name = "category"), - inverseJoinColumns = @JoinColumn(name = "supercategory")) - public Set supercategories; - - @ManyToMany(mappedBy = "supercategories", fetch = FetchType.LAZY) - public Set subcategories; - - @ManyToMany(fetch = FetchType.LAZY, mappedBy = "categories") - public Set
articles; -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java b/src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java deleted file mode 100644 index 4d6b148..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java +++ /dev/null @@ -1,34 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "login_certificates", schema = "public", catalog = "mulkcms") -@IdClass(LoginCertificatePK.class) -public class LoginCertificate extends PanacheEntityBase { - - @Id - @Column(name = "user", nullable = false) - public int userId; - - @Id - @Column(name = "certificate", nullable = false) - public byte[] certificate; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn( - name = "user", - referencedColumnName = "id", - nullable = false, - insertable = false, - updatable = false) - public User user; -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/LoginCertificatePK.java b/src/main/java/eu/mulk/mulkcms2/users/LoginCertificatePK.java deleted file mode 100644 index 0293cd7..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/LoginCertificatePK.java +++ /dev/null @@ -1,52 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class LoginCertificatePK implements Serializable { - - private int userId; - private byte[] certificate; - - @Column(name = "user", nullable = false) - @Id - public int getUserId() { - return userId; - } - - public void setUserId(int userId) { - this.userId = userId; - } - - @Column(name = "certificate", nullable = false) - @Id - public byte[] getCertificate() { - return certificate; - } - - public void setCertificate(byte[] certificate) { - this.certificate = certificate; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LoginCertificatePK that = (LoginCertificatePK) o; - return userId == that.userId && Arrays.equals(certificate, that.certificate); - } - - @Override - public int hashCode() { - int result = Objects.hash(userId); - result = 31 * result + Arrays.hashCode(certificate); - return result; - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/OpenId.java b/src/main/java/eu/mulk/mulkcms2/users/OpenId.java deleted file mode 100644 index a25730a..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/OpenId.java +++ /dev/null @@ -1,34 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "openids", schema = "public", catalog = "mulkcms") -@IdClass(OpenIdPK.class) -public class OpenId extends PanacheEntityBase { - - @Id - @Column(name = "user", nullable = false) - public int userId; - - @Id - @Column(name = "openid", nullable = false, length = -1) - public String openid; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn( - name = "user", - referencedColumnName = "id", - nullable = false, - insertable = false, - updatable = false) - public User user; -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/OpenIdPK.java b/src/main/java/eu/mulk/mulkcms2/users/OpenIdPK.java deleted file mode 100644 index 8f5ac05..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/OpenIdPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class OpenIdPK implements Serializable { - - private int userId; - private String openid; - - @Column(name = "user", nullable = false) - @Id - public int getUserId() { - return userId; - } - - public void setUserId(int userId) { - this.userId = userId; - } - - @Column(name = "openid", nullable = false, length = -1) - @Id - 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; - } - OpenIdPK openIdPK = (OpenIdPK) o; - return userId == openIdPK.userId && Objects.equals(openid, openIdPK.openid); - } - - @Override - public int hashCode() { - return Objects.hash(userId, openid); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/Password.java b/src/main/java/eu/mulk/mulkcms2/users/Password.java deleted file mode 100644 index b6156ce..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/Password.java +++ /dev/null @@ -1,34 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "passwords", schema = "public", catalog = "mulkcms") -@IdClass(PasswordPK.class) -public class Password extends PanacheEntityBase { - - @Id - @Column(name = "user", nullable = false) - public int userId; - - @Id - @Column(name = "password", nullable = false, length = -1) - public String password; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn( - name = "user", - referencedColumnName = "id", - nullable = false, - insertable = false, - updatable = false) - public User user; -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/PasswordPK.java b/src/main/java/eu/mulk/mulkcms2/users/PasswordPK.java deleted file mode 100644 index ca964b9..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/PasswordPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class PasswordPK implements Serializable { - - private int userId; - private String password; - - @Column(name = "user", nullable = false) - @Id - public int getUserId() { - return userId; - } - - public void setUserId(int userId) { - this.userId = userId; - } - - @Column(name = "password", nullable = false, length = -1) - @Id - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PasswordPK that = (PasswordPK) o; - return userId == that.userId && Objects.equals(password, that.password); - } - - @Override - public int hashCode() { - return Objects.hash(userId, password); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/User.java b/src/main/java/eu/mulk/mulkcms2/users/User.java deleted file mode 100644 index 62679c6..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/User.java +++ /dev/null @@ -1,54 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import eu.mulk.mulkcms2.comments.CommentRevision; -import eu.mulk.mulkcms2.pages.ArticleRevision; -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import java.util.Collection; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "users", schema = "public", catalog = "mulkcms") -public class User extends PanacheEntityBase { - - @Id - @Column(name = "id", nullable = false) - public int id; - - @Column(name = "name", nullable = true, length = -1) - public String name; - - @Column(name = "status", nullable = false, length = -1) - public String status; - - @Column(name = "email", nullable = true, length = -1) - public String email; - - @Column(name = "website", nullable = true, length = -1) - public String website; - - @OneToMany(mappedBy = "authors", fetch = FetchType.LAZY) - public Collection articleRevisions; - - @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) - public Collection commentRevisions; - - @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) - public Collection loginCertificates; - - @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) - public Collection openids; - - @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) - public Collection passwords; - - @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) - public Collection userPermissions; - - @OneToMany(mappedBy = "user", fetch = FetchType.LAZY) - public Collection userSettings; -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/UserPermission.java b/src/main/java/eu/mulk/mulkcms2/users/UserPermission.java deleted file mode 100644 index 1ab5e8c..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/UserPermission.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "user_permissions", schema = "public", catalog = "mulkcms") -@IdClass(UserPermissionPK.class) -public class UserPermission extends PanacheEntityBase { - - @Id - @Column(name = "user", nullable = false) - public int userId; - - @Id - @Column(name = "permission", nullable = false, length = -1) - public String permission; - - @Column(name = "status", nullable = true) - public Boolean status; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn( - name = "user", - referencedColumnName = "id", - nullable = false, - insertable = false, - updatable = false) - public User user; -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/UserPermissionPK.java b/src/main/java/eu/mulk/mulkcms2/users/UserPermissionPK.java deleted file mode 100644 index 4cb74b1..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/UserPermissionPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class UserPermissionPK implements Serializable { - - private int userId; - private String permission; - - @Column(name = "user", nullable = false) - @Id - public int getUserId() { - return userId; - } - - public void setUserId(int userId) { - this.userId = userId; - } - - @Column(name = "permission", nullable = false, length = -1) - @Id - public String getPermission() { - return permission; - } - - public void setPermission(String permission) { - this.permission = permission; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserPermissionPK that = (UserPermissionPK) o; - return userId == that.userId && Objects.equals(permission, that.permission); - } - - @Override - public int hashCode() { - return Objects.hash(userId, permission); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/UserSetting.java b/src/main/java/eu/mulk/mulkcms2/users/UserSetting.java deleted file mode 100644 index 66742c7..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/UserSetting.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; - -@Entity -@Table(name = "user_settings", schema = "public", catalog = "mulkcms") -@IdClass(UserSettingPK.class) -public class UserSetting extends PanacheEntityBase { - - @Id - @Column(name = "user", nullable = false) - public int userId; - - @Id - @Column(name = "setting", nullable = false, length = -1) - public String setting; - - @Column(name = "value", nullable = true, length = -1) - public String value; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn( - name = "user", - referencedColumnName = "id", - nullable = false, - insertable = false, - updatable = false) - public User user; -} diff --git a/src/main/java/eu/mulk/mulkcms2/users/UserSettingPK.java b/src/main/java/eu/mulk/mulkcms2/users/UserSettingPK.java deleted file mode 100644 index 4514fe2..0000000 --- a/src/main/java/eu/mulk/mulkcms2/users/UserSettingPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.users; - -import java.io.Serializable; -import java.util.Objects; -import javax.persistence.Column; -import javax.persistence.Id; - -public class UserSettingPK implements Serializable { - - private int userId; - private String setting; - - @Column(name = "user", nullable = false) - @Id - public int getUserId() { - return userId; - } - - public void setUserId(int userId) { - this.userId = userId; - } - - @Column(name = "setting", nullable = false, length = -1) - @Id - public String getSetting() { - return setting; - } - - public void setSetting(String setting) { - this.setting = setting; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UserSettingPK that = (UserSettingPK) o; - return userId == that.userId && Objects.equals(setting, that.setting); - } - - @Override - public int hashCode() { - return Objects.hash(userId, setting); - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/web/ExampleResource.java b/src/main/java/eu/mulk/mulkcms2/web/ExampleResource.java deleted file mode 100644 index 4951eb4..0000000 --- a/src/main/java/eu/mulk/mulkcms2/web/ExampleResource.java +++ /dev/null @@ -1,14 +0,0 @@ -package eu.mulk.mulkcms2.web; - -import javax.ws.rs.GET; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -public class ExampleResource { - - @GET - @Produces({MediaType.TEXT_PLAIN}) - public String hello() { - return "hello!"; - } -} -- cgit v1.2.3