From e7fc79a52b61a942c5259d5a133fc3f2876fa734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9?= Date: Mon, 10 Apr 2023 22:57:15 +0400 Subject: [PATCH] =?UTF-8?q?orphanRemoval=20=D0=BD=D0=B5=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82=20=D0=B4=D0=BB=D1=8F=20Man?= =?UTF-8?q?yToMany?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/LabWork/app/MangaStore/model/Default/Reader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/LabWork/app/MangaStore/model/Default/Reader.java b/src/main/java/com/LabWork/app/MangaStore/model/Default/Reader.java index bd216ab..546f1d0 100644 --- a/src/main/java/com/LabWork/app/MangaStore/model/Default/Reader.java +++ b/src/main/java/com/LabWork/app/MangaStore/model/Default/Reader.java @@ -1,6 +1,7 @@ package com.LabWork.app.MangaStore.model.Default; import jakarta.persistence.*; +import org.hibernate.annotations.Cascade; import java.util.ArrayList; import java.util.List; @@ -19,6 +20,8 @@ public class Reader { private String hashedPassword; @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.MERGE) + /*@Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)*/ + /*orphanRemoval=true*/ private List mangas; public Reader() {