fix: 取消标签表的外键关联
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
package com.lanyuanxiaoyao.bookstore
|
package com.lanyuanxiaoyao.bookstore
|
||||||
|
|
||||||
import jakarta.persistence.CascadeType
|
import jakarta.persistence.CascadeType
|
||||||
|
import jakarta.persistence.CollectionTable
|
||||||
import jakarta.persistence.Column
|
import jakarta.persistence.Column
|
||||||
import jakarta.persistence.ConstraintMode
|
import jakarta.persistence.ConstraintMode
|
||||||
import jakarta.persistence.ElementCollection
|
import jakarta.persistence.ElementCollection
|
||||||
@@ -41,6 +42,7 @@ class Book(
|
|||||||
var description: String,
|
var description: String,
|
||||||
var source: String?,
|
var source: String?,
|
||||||
@ElementCollection(fetch = FetchType.EAGER)
|
@ElementCollection(fetch = FetchType.EAGER)
|
||||||
|
@CollectionTable(foreignKey = ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||||
var tags: MutableSet<String> = mutableSetOf(),
|
var tags: MutableSet<String> = mutableSetOf(),
|
||||||
@OneToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY, mappedBy = "book")
|
@OneToMany(cascade = [CascadeType.ALL], fetch = FetchType.LAZY, mappedBy = "book")
|
||||||
var chapters: MutableSet<Chapter> = mutableSetOf(),
|
var chapters: MutableSet<Chapter> = mutableSetOf(),
|
||||||
|
|||||||
Reference in New Issue
Block a user