From e28673d659e1b1f7a5b1a6a9c00aec18503d84a6 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 9 Feb 2020 10:51:24 +0100 Subject: Rename bookmarx => bookmarks, lafargue => lazychat. Change-Id: I0938267d9b7e8c9685f18a5e217b62df1bcab49b --- .../eu/mulk/mulkcms2/benki/bookmarks/Bookmark.java | 26 ++++++++++ .../mulk/mulkcms2/benki/bookmarks/BookmarkTag.java | 29 +++++++++++ .../mulkcms2/benki/bookmarks/BookmarkTagPK.java | 59 ++++++++++++++++++++++ .../eu/mulk/mulkcms2/benki/bookmarx/Bookmark.java | 26 ---------- .../mulk/mulkcms2/benki/bookmarx/BookmarkTag.java | 29 ----------- .../mulkcms2/benki/bookmarx/BookmarkTagPK.java | 59 ---------------------- .../mulkcms2/benki/lafargue/LazychatMessage.java | 23 --------- .../mulkcms2/benki/lafargue/LazychatReference.java | 33 ------------ .../benki/lafargue/LazychatReferencePK.java | 59 ---------------------- .../mulkcms2/benki/lazychat/LazychatMessage.java | 23 +++++++++ .../mulkcms2/benki/lazychat/LazychatReference.java | 33 ++++++++++++ .../benki/lazychat/LazychatReferencePK.java | 59 ++++++++++++++++++++++ .../java/eu/mulk/mulkcms2/benki/users/User.java | 4 +- src/main/resources/templates/base.html | 4 +- 14 files changed, 233 insertions(+), 233 deletions(-) create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/bookmarks/Bookmark.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTag.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTagPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/benki/bookmarx/Bookmark.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTag.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTagPK.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatMessage.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReference.java delete mode 100644 src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReferencePK.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatMessage.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReference.java create mode 100644 src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/Bookmark.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/Bookmark.java new file mode 100644 index 0000000..783a882 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/Bookmark.java @@ -0,0 +1,26 @@ +package eu.mulk.mulkcms2.benki.bookmarks; + +import eu.mulk.mulkcms2.benki.generic.Post; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "bookmarks", schema = "benki") +public class Bookmark extends Post { + + @Column(name = "uri", nullable = false, length = -1) + public String uri; + + @Column(name = "title", nullable = true, length = -1) + public String title; + + @Column(name = "description", nullable = true, length = -1) + public String description; + + @OneToMany(mappedBy = "bookmark", fetch = FetchType.LAZY) + public Collection tags; +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTag.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTag.java new file mode 100644 index 0000000..ce2d1c6 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTag.java @@ -0,0 +1,29 @@ +package eu.mulk.mulkcms2.benki.bookmarks; + +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 = "bookmark_tags", schema = "benki") +@IdClass(BookmarkTagPK.class) +public class BookmarkTag extends PanacheEntityBase { + + @Id + @Column(name = "bookmark", nullable = false) + public int bookmarkId; + + @Id + @Column(name = "tag", nullable = false, length = -1) + public String tag; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "bookmark", referencedColumnName = "id", nullable = false) + public Bookmark bookmark; +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTagPK.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTagPK.java new file mode 100644 index 0000000..e8abb3b --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/bookmarks/BookmarkTagPK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki.bookmarks; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class BookmarkTagPK implements Serializable { + + private int bookmarkId; + private String tag; + + @Column(name = "bookmark", nullable = false) + @Id + public int getBookmarkId() { + return bookmarkId; + } + + public void setBookmarkId(int bookmarkId) { + this.bookmarkId = bookmarkId; + } + + @Column(name = "tag", nullable = false, length = -1) + @Id + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + BookmarkTagPK that = (BookmarkTagPK) o; + + if (bookmarkId != that.bookmarkId) { + return false; + } + if (tag != null ? !tag.equals(that.tag) : that.tag != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = bookmarkId; + result = 31 * result + (tag != null ? tag.hashCode() : 0); + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/Bookmark.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/Bookmark.java deleted file mode 100644 index d021290..0000000 --- a/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/Bookmark.java +++ /dev/null @@ -1,26 +0,0 @@ -package eu.mulk.mulkcms2.benki.bookmarx; - -import eu.mulk.mulkcms2.benki.generic.Post; -import java.util.Collection; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "bookmarks", schema = "benki") -public class Bookmark extends Post { - - @Column(name = "uri", nullable = false, length = -1) - public String uri; - - @Column(name = "title", nullable = true, length = -1) - public String title; - - @Column(name = "description", nullable = true, length = -1) - public String description; - - @OneToMany(mappedBy = "bookmark", fetch = FetchType.LAZY) - public Collection tags; -} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTag.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTag.java deleted file mode 100644 index 32136b7..0000000 --- a/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTag.java +++ /dev/null @@ -1,29 +0,0 @@ -package eu.mulk.mulkcms2.benki.bookmarx; - -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 = "bookmark_tags", schema = "benki") -@IdClass(BookmarkTagPK.class) -public class BookmarkTag extends PanacheEntityBase { - - @Id - @Column(name = "bookmark", nullable = false) - public int bookmarkId; - - @Id - @Column(name = "tag", nullable = false, length = -1) - public String tag; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "bookmark", referencedColumnName = "id", nullable = false) - public Bookmark bookmark; -} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTagPK.java b/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTagPK.java deleted file mode 100644 index 876648d..0000000 --- a/src/main/java/eu/mulk/mulkcms2/benki/bookmarx/BookmarkTagPK.java +++ /dev/null @@ -1,59 +0,0 @@ -package eu.mulk.mulkcms2.benki.bookmarx; - -import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Id; - -public class BookmarkTagPK implements Serializable { - - private int bookmarkId; - private String tag; - - @Column(name = "bookmark", nullable = false) - @Id - public int getBookmarkId() { - return bookmarkId; - } - - public void setBookmarkId(int bookmarkId) { - this.bookmarkId = bookmarkId; - } - - @Column(name = "tag", nullable = false, length = -1) - @Id - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - BookmarkTagPK that = (BookmarkTagPK) o; - - if (bookmarkId != that.bookmarkId) { - return false; - } - if (tag != null ? !tag.equals(that.tag) : that.tag != null) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - int result = bookmarkId; - result = 31 * result + (tag != null ? tag.hashCode() : 0); - return result; - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatMessage.java b/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatMessage.java deleted file mode 100644 index d3fbf2e..0000000 --- a/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatMessage.java +++ /dev/null @@ -1,23 +0,0 @@ -package eu.mulk.mulkcms2.benki.lafargue; - -import eu.mulk.mulkcms2.benki.generic.Post; -import java.util.Collection; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "lazychat_messages", schema = "benki") -public class LazychatMessage extends Post { - - @Column(name = "content", nullable = true, length = -1) - public String content; - - @Column(name = "format", nullable = false, length = -1) - public String format; - - @OneToMany(mappedBy = "referrer", fetch = FetchType.LAZY) - public Collection references; -} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReference.java b/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReference.java deleted file mode 100644 index 2cf34d1..0000000 --- a/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReference.java +++ /dev/null @@ -1,33 +0,0 @@ -package eu.mulk.mulkcms2.benki.lafargue; - -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 = "lazychat_references", schema = "benki") -@IdClass(LazychatReferencePK.class) -public class LazychatReference extends PanacheEntityBase { - - @Id - @Column(name = "referrer", nullable = false) - public int referrerId; - - @Id - @Column(name = "referee", nullable = false) - public int refereeId; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "referrer", referencedColumnName = "id", nullable = false) - public LazychatMessage referrer; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "referee", referencedColumnName = "id", nullable = false) - public LazychatMessage referee; -} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReferencePK.java b/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReferencePK.java deleted file mode 100644 index 6e2d965..0000000 --- a/src/main/java/eu/mulk/mulkcms2/benki/lafargue/LazychatReferencePK.java +++ /dev/null @@ -1,59 +0,0 @@ -package eu.mulk.mulkcms2.benki.lafargue; - -import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Id; - -public class LazychatReferencePK implements Serializable { - - private int referrerId; - private int refereeId; - - @Column(name = "referrer", nullable = false) - @Id - public int getReferrerId() { - return referrerId; - } - - public void setReferrerId(int referrerId) { - this.referrerId = referrerId; - } - - @Column(name = "referee", nullable = false) - @Id - public int getRefereeId() { - return refereeId; - } - - public void setRefereeId(int refereeId) { - this.refereeId = refereeId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LazychatReferencePK that = (LazychatReferencePK) o; - - if (referrerId != that.referrerId) { - return false; - } - if (refereeId != that.refereeId) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - int result = referrerId; - result = 31 * result + refereeId; - return result; - } -} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatMessage.java b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatMessage.java new file mode 100644 index 0000000..de1e0cc --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatMessage.java @@ -0,0 +1,23 @@ +package eu.mulk.mulkcms2.benki.lazychat; + +import eu.mulk.mulkcms2.benki.generic.Post; +import java.util.Collection; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "lazychat_messages", schema = "benki") +public class LazychatMessage extends Post { + + @Column(name = "content", nullable = true, length = -1) + public String content; + + @Column(name = "format", nullable = false, length = -1) + public String format; + + @OneToMany(mappedBy = "referrer", fetch = FetchType.LAZY) + public Collection references; +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReference.java b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReference.java new file mode 100644 index 0000000..eecc23e --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReference.java @@ -0,0 +1,33 @@ +package eu.mulk.mulkcms2.benki.lazychat; + +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 = "lazychat_references", schema = "benki") +@IdClass(LazychatReferencePK.class) +public class LazychatReference extends PanacheEntityBase { + + @Id + @Column(name = "referrer", nullable = false) + public int referrerId; + + @Id + @Column(name = "referee", nullable = false) + public int refereeId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "referrer", referencedColumnName = "id", nullable = false) + public LazychatMessage referrer; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "referee", referencedColumnName = "id", nullable = false) + public LazychatMessage referee; +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java new file mode 100644 index 0000000..28ee2e0 --- /dev/null +++ b/src/main/java/eu/mulk/mulkcms2/benki/lazychat/LazychatReferencePK.java @@ -0,0 +1,59 @@ +package eu.mulk.mulkcms2.benki.lazychat; + +import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Id; + +public class LazychatReferencePK implements Serializable { + + private int referrerId; + private int refereeId; + + @Column(name = "referrer", nullable = false) + @Id + public int getReferrerId() { + return referrerId; + } + + public void setReferrerId(int referrerId) { + this.referrerId = referrerId; + } + + @Column(name = "referee", nullable = false) + @Id + public int getRefereeId() { + return refereeId; + } + + public void setRefereeId(int refereeId) { + this.refereeId = refereeId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + LazychatReferencePK that = (LazychatReferencePK) o; + + if (referrerId != that.referrerId) { + return false; + } + if (refereeId != that.refereeId) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = referrerId; + result = 31 * result + refereeId; + return result; + } +} diff --git a/src/main/java/eu/mulk/mulkcms2/benki/users/User.java b/src/main/java/eu/mulk/mulkcms2/benki/users/User.java index c1ab89b..2a0d5f4 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/users/User.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/users/User.java @@ -2,9 +2,9 @@ package eu.mulk.mulkcms2.benki.users; import eu.mulk.mulkcms2.benki.accesscontrol.PageKey; import eu.mulk.mulkcms2.benki.accesscontrol.Role; -import eu.mulk.mulkcms2.benki.bookmarx.Bookmark; +import eu.mulk.mulkcms2.benki.bookmarks.Bookmark; import eu.mulk.mulkcms2.benki.generic.Post; -import eu.mulk.mulkcms2.benki.lafargue.LazychatMessage; +import eu.mulk.mulkcms2.benki.lazychat.LazychatMessage; import eu.mulk.mulkcms2.benki.wiki.WikiPageRevision; import io.quarkus.hibernate.orm.panache.PanacheEntityBase; import java.util.Collection; diff --git a/src/main/resources/templates/base.html b/src/main/resources/templates/base.html index aec554a..b64f5fb 100644 --- a/src/main/resources/templates/base.html +++ b/src/main/resources/templates/base.html @@ -19,8 +19,8 @@ -- cgit v1.2.3