orphanRemoval не работает для ManyToMany
This commit is contained in:
parent
c3ebc3dbf6
commit
e7fc79a52b
@ -1,6 +1,7 @@
|
|||||||
package com.LabWork.app.MangaStore.model.Default;
|
package com.LabWork.app.MangaStore.model.Default;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
import org.hibernate.annotations.Cascade;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -19,6 +20,8 @@ public class Reader {
|
|||||||
private String hashedPassword;
|
private String hashedPassword;
|
||||||
|
|
||||||
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
|
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
|
||||||
|
/*@Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)*/
|
||||||
|
/*orphanRemoval=true*/
|
||||||
private List<Manga> mangas;
|
private List<Manga> mangas;
|
||||||
|
|
||||||
public Reader() {
|
public Reader() {
|
||||||
|
Loading…
Reference in New Issue
Block a user