diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2023-08-06 21:21:50 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2023-08-06 21:22:32 +0200 |
commit | 2fa30295863c83e7cdf160164b52ace9c22775ec (patch) | |
tree | 156b9b7b0c5d45d112c1af6a2fa8603811fdfce1 /src/main | |
parent | 475bf006583288e6544374ba7c5d085f0b4235f2 (diff) |
Fix various Hibernate mapping oversights.
Change-Id: Iff22c68a718d6f65734e166cd08f4049ccc196ec
Diffstat (limited to 'src/main')
3 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/Newsletter.java b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/Newsletter.java index 7c9e50f..9c21e69 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/Newsletter.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/Newsletter.java @@ -23,7 +23,7 @@ public class Newsletter extends PanacheEntityBase { @Column(name = "date", nullable = false) public OffsetDateTime date = OffsetDateTime.now(); - @OneToMany(mappedBy = "owner", fetch = FetchType.LAZY) + @OneToMany(mappedBy = "newsletter", fetch = FetchType.LAZY) @OrderBy("date") public Collection<Post> posts; } diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java index 0350a20..20fcabe 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/Post.java @@ -73,7 +73,7 @@ public abstract class Post extends PanacheEntityBase { @CheckForNull public OffsetDateTime date; - @Column(nullable = false) + @Column(nullable = false, columnDefinition = "benki.post_scope") @Enumerated(EnumType.STRING) @Type(PostgreSQLEnumType.class) public Scope scope = Scope.top_level; diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java index d25615e..177c590 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostText.java @@ -47,7 +47,7 @@ public abstract class PostText extends PanacheEntityBase { @CheckForNull public String cachedDescriptionHtml; - @Column(name = "search_terms") + @Column(name = "search_terms", columnDefinition = "tsvector") @Generated(event = {INSERT, UPDATE}) @Type(value = PostgreSQLTSVectorType.class) public String searchTerms; |