From 444c812bc2a22dbefb4645eab3240f239f55f409 Mon Sep 17 00:00:00 2001 From: Avgustin Marinov Date: Fri, 15 Nov 2024 13:11:46 +0200 Subject: [PATCH] Fix CascadeType.REMOVE on ManyToOne (#2030) Signed-off-by: Avgustin Marinov --- .../repository/jpa/model/DistributionSetTypeElement.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/DistributionSetTypeElement.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/DistributionSetTypeElement.java index 85a58168d..bfa47fc51 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/DistributionSetTypeElement.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/DistributionSetTypeElement.java @@ -44,12 +44,12 @@ public class DistributionSetTypeElement implements Serializable { private boolean mandatory; @MapsId("dsType") - @ManyToOne(optional = false, fetch = FetchType.LAZY, cascade = { CascadeType.REMOVE }) + @ManyToOne(optional = false, fetch = FetchType.LAZY) @JoinColumn(name = "distribution_set_type", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_type_element_element")) private JpaDistributionSetType dsType; @MapsId("smType") - @ManyToOne(optional = false, fetch = FetchType.LAZY, cascade = { CascadeType.REMOVE }) + @ManyToOne(optional = false, fetch = FetchType.LAZY) @JoinColumn(name = "software_module_type", nullable = false, updatable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_type_element_smtype")) private JpaSoftwareModuleType smType;