fix: 取消标签表的外键关联
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user