From 378b93ee52512659b0b886540b1f122a545b66ac Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 19 Jan 2020 16:53:10 +0100 Subject: Reorganize packages. Change-Id: Ie40dbeb7a05edf4e847b9ca88b1d9179e50dee5f --- .../java/eu/mulk/mulkcms2/comments/Comment.java | 32 +++++++++++ .../eu/mulk/mulkcms2/comments/CommentRevision.java | 54 ++++++++++++++++++ .../mulk/mulkcms2/comments/UsedTransactionKey.java | 16 ++++++ src/main/java/eu/mulk/mulkcms2/entity/Article.java | 47 ---------------- .../java/eu/mulk/mulkcms2/entity/ArticleAlias.java | 23 -------- .../eu/mulk/mulkcms2/entity/ArticleBranchTip.java | 22 -------- .../mulk/mulkcms2/entity/ArticleBranchTipPK.java | 49 ---------------- .../mulk/mulkcms2/entity/ArticleCommentCount.java | 19 ------- .../mulkcms2/entity/ArticlePublishingDate.java | 20 ------- .../eu/mulk/mulkcms2/entity/ArticleRevision.java | 64 --------------------- .../entity/ArticleRevisionCharacteristic.java | 37 ------------ .../entity/ArticleRevisionCharacteristicPK.java | 46 --------------- .../java/eu/mulk/mulkcms2/entity/ArticleType.java | 28 ---------- .../java/eu/mulk/mulkcms2/entity/CachedPage.java | 29 ---------- .../java/eu/mulk/mulkcms2/entity/CachedPagePK.java | 49 ---------------- .../java/eu/mulk/mulkcms2/entity/Category.java | 34 ----------- src/main/java/eu/mulk/mulkcms2/entity/Comment.java | 31 ----------- .../eu/mulk/mulkcms2/entity/CommentRevision.java | 53 ------------------ src/main/java/eu/mulk/mulkcms2/entity/Journal.java | 25 --------- .../java/eu/mulk/mulkcms2/entity/JournalEntry.java | 38 ------------- .../eu/mulk/mulkcms2/entity/JournalEntryPK.java | 49 ---------------- .../mulkcms2/entity/LegacyJournalCategory.java | 19 ------- .../mulk/mulkcms2/entity/LegacyJournalComment.java | 50 ----------------- .../mulk/mulkcms2/entity/LegacyJournalEntry.java | 46 --------------- .../mulkcms2/entity/LegacyJournalPingback.java | 41 -------------- .../mulkcms2/entity/LegacyJournalTrackback.java | 50 ----------------- .../eu/mulk/mulkcms2/entity/LoginCertificate.java | 34 ----------- .../mulk/mulkcms2/entity/LoginCertificatePK.java | 52 ----------------- src/main/java/eu/mulk/mulkcms2/entity/OpenId.java | 34 ----------- .../java/eu/mulk/mulkcms2/entity/OpenIdPK.java | 49 ---------------- .../java/eu/mulk/mulkcms2/entity/Password.java | 34 ----------- .../java/eu/mulk/mulkcms2/entity/PasswordPK.java | 49 ---------------- .../mulk/mulkcms2/entity/UsedTransactionKey.java | 16 ------ src/main/java/eu/mulk/mulkcms2/entity/User.java | 52 ----------------- .../eu/mulk/mulkcms2/entity/UserPermission.java | 37 ------------ .../eu/mulk/mulkcms2/entity/UserPermissionPK.java | 49 ---------------- .../java/eu/mulk/mulkcms2/entity/UserSetting.java | 37 ------------ .../eu/mulk/mulkcms2/entity/UserSettingPK.java | 49 ---------------- .../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 | 34 +++++++++++ .../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 ++++++++++++++++ 70 files changed, 1375 insertions(+), 1361 deletions(-) create mode 100644 src/main/java/eu/mulk/mulkcms2/comments/Comment.java create mode 100644 src/main/java/eu/mulk/mulkcms2/comments/CommentRevision.java create mode 100644 src/main/java/eu/mulk/mulkcms2/comments/UsedTransactionKey.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/Article.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleAlias.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTip.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleCommentCount.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticlePublishingDate.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleRevision.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristic.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/ArticleType.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/CachedPage.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/CachedPagePK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/Category.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/Comment.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/CommentRevision.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/Journal.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/JournalEntry.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/JournalEntryPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalCategory.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalComment.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalEntry.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalPingback.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalTrackback.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/LoginCertificate.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/LoginCertificatePK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/OpenId.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/OpenIdPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/Password.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/PasswordPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/UsedTransactionKey.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/User.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/UserPermission.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/UserPermissionPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/UserSetting.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/entity/UserSettingPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/journal/Journal.java create mode 100644 src/main/java/eu/mulk/mulkcms2/journal/JournalEntry.java create mode 100644 src/main/java/eu/mulk/mulkcms2/journal/JournalEntryPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalCategory.java create mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalComment.java create mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalEntry.java create mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalPingback.java create mode 100644 src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalTrackback.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/Article.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleAlias.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTip.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTipPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleCommentCount.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticlePublishingDate.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleRevision.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristic.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristicPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/ArticleType.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/CachedPage.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/CachedPagePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/pages/Category.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/LoginCertificatePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/OpenId.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/OpenIdPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/Password.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/PasswordPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/User.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserPermission.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserPermissionPK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserSetting.java create mode 100644 src/main/java/eu/mulk/mulkcms2/users/UserSettingPK.java (limited to 'src/main/java') diff --git a/src/main/java/eu/mulk/mulkcms2/comments/Comment.java b/src/main/java/eu/mulk/mulkcms2/comments/Comment.java new file mode 100644 index 0000000..d14fef6 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/comments/Comment.java @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000..9d543b9 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/comments/CommentRevision.java @@ -0,0 +1,54 @@ +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 new file mode 100644 index 0000000..133ce5a --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/comments/UsedTransactionKey.java @@ -0,0 +1,16 @@ +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/entity/Article.java b/src/main/java/eu/mulk/mulkcms2/entity/Article.java deleted file mode 100644 index 8d3aa7e..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/Article.java +++ /dev/null @@ -1,47 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/ArticleAlias.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleAlias.java deleted file mode 100644 index 7974d5e..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleAlias.java +++ /dev/null @@ -1,23 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/ArticleBranchTip.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTip.java deleted file mode 100644 index eacc151..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTip.java +++ /dev/null @@ -1,22 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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; - -@Entity -@Table(name = "article_branch_tips", schema = "public", catalog = "mulkcms") -@IdClass(ArticleBranchTipPK.class) -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/entity/ArticleBranchTipPK.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java deleted file mode 100644 index 6472a8d..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleBranchTipPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/ArticleCommentCount.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleCommentCount.java deleted file mode 100644 index 4ec408d..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleCommentCount.java +++ /dev/null @@ -1,19 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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 = "article_comment_counts", schema = "public", catalog = "mulkcms") -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/entity/ArticlePublishingDate.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticlePublishingDate.java deleted file mode 100644 index 39d0c4a..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticlePublishingDate.java +++ /dev/null @@ -1,20 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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; - -@Entity -@Table(name = "article_publishing_dates", schema = "public", catalog = "mulkcms") -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/entity/ArticleRevision.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevision.java deleted file mode 100644 index f9ed05c..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevision.java +++ /dev/null @@ -1,64 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/ArticleRevisionCharacteristic.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristic.java deleted file mode 100644 index cd7c302..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristic.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/ArticleRevisionCharacteristicPK.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java deleted file mode 100644 index edaaff1..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleRevisionCharacteristicPK.java +++ /dev/null @@ -1,46 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/ArticleType.java b/src/main/java/eu/mulk/mulkcms2/entity/ArticleType.java deleted file mode 100644 index 0a98680..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/ArticleType.java +++ /dev/null @@ -1,28 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/CachedPage.java b/src/main/java/eu/mulk/mulkcms2/entity/CachedPage.java deleted file mode 100644 index 36fff48..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/CachedPage.java +++ /dev/null @@ -1,29 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/CachedPagePK.java b/src/main/java/eu/mulk/mulkcms2/entity/CachedPagePK.java deleted file mode 100644 index e4b6fc3..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/CachedPagePK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/Category.java b/src/main/java/eu/mulk/mulkcms2/entity/Category.java deleted file mode 100644 index 08c473b..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/Category.java +++ /dev/null @@ -1,34 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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; -} diff --git a/src/main/java/eu/mulk/mulkcms2/entity/Comment.java b/src/main/java/eu/mulk/mulkcms2/entity/Comment.java deleted file mode 100644 index 0e3cb16..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/Comment.java +++ /dev/null @@ -1,31 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/CommentRevision.java b/src/main/java/eu/mulk/mulkcms2/entity/CommentRevision.java deleted file mode 100644 index 920bff6..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/CommentRevision.java +++ /dev/null @@ -1,53 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -import com.vladmihalcea.hibernate.type.basic.Inet; -import com.vladmihalcea.hibernate.type.basic.PostgreSQLInetType; -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/entity/Journal.java b/src/main/java/eu/mulk/mulkcms2/entity/Journal.java deleted file mode 100644 index 865f3af..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/Journal.java +++ /dev/null @@ -1,25 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/JournalEntry.java b/src/main/java/eu/mulk/mulkcms2/entity/JournalEntry.java deleted file mode 100644 index 7dedf02..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/JournalEntry.java +++ /dev/null @@ -1,38 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/JournalEntryPK.java b/src/main/java/eu/mulk/mulkcms2/entity/JournalEntryPK.java deleted file mode 100644 index 2d00c6e..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/JournalEntryPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/LegacyJournalCategory.java b/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalCategory.java deleted file mode 100644 index b2837c7..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalCategory.java +++ /dev/null @@ -1,19 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/LegacyJournalComment.java b/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalComment.java deleted file mode 100644 index 00144fe..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalComment.java +++ /dev/null @@ -1,50 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/LegacyJournalEntry.java b/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalEntry.java deleted file mode 100644 index dd905d1..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalEntry.java +++ /dev/null @@ -1,46 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/LegacyJournalPingback.java b/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalPingback.java deleted file mode 100644 index a629a78..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalPingback.java +++ /dev/null @@ -1,41 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/LegacyJournalTrackback.java b/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalTrackback.java deleted file mode 100644 index 6bd0920..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/LegacyJournalTrackback.java +++ /dev/null @@ -1,50 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/LoginCertificate.java b/src/main/java/eu/mulk/mulkcms2/entity/LoginCertificate.java deleted file mode 100644 index 0218aec..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/LoginCertificate.java +++ /dev/null @@ -1,34 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/LoginCertificatePK.java b/src/main/java/eu/mulk/mulkcms2/entity/LoginCertificatePK.java deleted file mode 100644 index 4ab6ad9..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/LoginCertificatePK.java +++ /dev/null @@ -1,52 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/OpenId.java b/src/main/java/eu/mulk/mulkcms2/entity/OpenId.java deleted file mode 100644 index 444bf3e..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/OpenId.java +++ /dev/null @@ -1,34 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/OpenIdPK.java b/src/main/java/eu/mulk/mulkcms2/entity/OpenIdPK.java deleted file mode 100644 index 7ce0693..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/OpenIdPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/Password.java b/src/main/java/eu/mulk/mulkcms2/entity/Password.java deleted file mode 100644 index c1505f2..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/Password.java +++ /dev/null @@ -1,34 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/PasswordPK.java b/src/main/java/eu/mulk/mulkcms2/entity/PasswordPK.java deleted file mode 100644 index f9fc7f6..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/PasswordPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/UsedTransactionKey.java b/src/main/java/eu/mulk/mulkcms2/entity/UsedTransactionKey.java deleted file mode 100644 index f1a6f68..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/UsedTransactionKey.java +++ /dev/null @@ -1,16 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/User.java b/src/main/java/eu/mulk/mulkcms2/entity/User.java deleted file mode 100644 index 3c606b9..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/User.java +++ /dev/null @@ -1,52 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/UserPermission.java b/src/main/java/eu/mulk/mulkcms2/entity/UserPermission.java deleted file mode 100644 index 8290f8f..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/UserPermission.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/UserPermissionPK.java b/src/main/java/eu/mulk/mulkcms2/entity/UserPermissionPK.java deleted file mode 100644 index fd0e89d..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/UserPermissionPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/UserSetting.java b/src/main/java/eu/mulk/mulkcms2/entity/UserSetting.java deleted file mode 100644 index 1ecd781..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/UserSetting.java +++ /dev/null @@ -1,37 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/entity/UserSettingPK.java b/src/main/java/eu/mulk/mulkcms2/entity/UserSettingPK.java deleted file mode 100644 index 5530750..0000000 --- a/src/main/java/eu/mulk/mulkcms2/entity/UserSettingPK.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.mulk.mulkcms2.entity; - -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/journal/Journal.java b/src/main/java/eu/mulk/mulkcms2/journal/Journal.java new file mode 100644 index 0000000..44fe2a4 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/journal/Journal.java @@ -0,0 +1,25 @@ +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 new file mode 100644 index 0000000..bc54845 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/journal/JournalEntry.java @@ -0,0 +1,39 @@ +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 new file mode 100644 index 0000000..1c9d063 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/journal/JournalEntryPK.java @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000..0e6108e --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalCategory.java @@ -0,0 +1,19 @@ +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 new file mode 100644 index 0000000..eecc1e6 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalComment.java @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..f736357 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalEntry.java @@ -0,0 +1,46 @@ +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 new file mode 100644 index 0000000..f32ae07 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalPingback.java @@ -0,0 +1,41 @@ +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 new file mode 100644 index 0000000..4329965 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/legacyjournal/LegacyJournalTrackback.java @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..7f83a12 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/Article.java @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000..d983eac --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleAlias.java @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000..f7d5404 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTip.java @@ -0,0 +1,24 @@ +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 new file mode 100644 index 0000000..2bb6039 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleBranchTipPK.java @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000..612f26c --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleCommentCount.java @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..8f3c7d1 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticlePublishingDate.java @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000..9d1f95b --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevision.java @@ -0,0 +1,65 @@ +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 new file mode 100644 index 0000000..d6a0a67 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristic.java @@ -0,0 +1,37 @@ +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 new file mode 100644 index 0000000..9423ee4 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleRevisionCharacteristicPK.java @@ -0,0 +1,46 @@ +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 new file mode 100644 index 0000000..2f0eccb --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/ArticleType.java @@ -0,0 +1,28 @@ +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 new file mode 100644 index 0000000..7723588 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/CachedPage.java @@ -0,0 +1,29 @@ +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 new file mode 100644 index 0000000..e3fc089 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/CachedPagePK.java @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000..06e2429 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/pages/Category.java @@ -0,0 +1,34 @@ +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; +} diff --git a/src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java b/src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java new file mode 100644 index 0000000..4d6b148 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/LoginCertificate.java @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000..0293cd7 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/LoginCertificatePK.java @@ -0,0 +1,52 @@ +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 new file mode 100644 index 0000000..a25730a --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/OpenId.java @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000..8f5ac05 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/OpenIdPK.java @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000..b6156ce --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/Password.java @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000..ca964b9 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/PasswordPK.java @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000..62679c6 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/User.java @@ -0,0 +1,54 @@ +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 new file mode 100644 index 0000000..1ab5e8c --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/UserPermission.java @@ -0,0 +1,37 @@ +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 new file mode 100644 index 0000000..4cb74b1 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/UserPermissionPK.java @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000..66742c7 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/UserSetting.java @@ -0,0 +1,37 @@ +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 new file mode 100644 index 0000000..4514fe2 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/users/UserSettingPK.java @@ -0,0 +1,49 @@ +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); + } +} -- cgit v1.2.3