1
0

fix: 取消标签表的外键关联

This commit is contained in:
2024-12-22 12:15:14 +08:00
parent 23b0d56f39
commit 0052494ec5

View File

@@ -3,6 +3,7 @@
package com.lanyuanxiaoyao.bookstore
import jakarta.persistence.CascadeType
import jakarta.persistence.CollectionTable
import jakarta.persistence.Column
import jakarta.persistence.ConstraintMode
import jakarta.persistence.ElementCollection
@@ -41,6 +42,7 @@ class Book(
var description: String,
var source: String?,
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(foreignKey = ForeignKey(ConstraintMode.NO_CONSTRAINT))
var tags: MutableSet<String> = mutableSetOf(),
@OneToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY, mappedBy = "book")
var chapters: MutableSet<Chapter> = mutableSetOf(),