orphanRemoval не работает для ManyToMany

This commit is contained in:
Николай 2023-04-10 22:57:15 +04:00
parent c3ebc3dbf6
commit e7fc79a52b

View File

@ -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() {