Fix various Hibernate mapping oversights.
Change-Id: Iff22c68a718d6f65734e166cd08f4049ccc196ec
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 @@
@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 @@
@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 @@
@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;