Fix CascadeType.REMOVE on ManyToMany (#2029)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -86,7 +86,7 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
||||
@NotNull
|
||||
private DistributionSetType type;
|
||||
|
||||
@ManyToMany(targetEntity = JpaSoftwareModule.class, fetch = FetchType.LAZY, cascade = { CascadeType.REMOVE })
|
||||
@ManyToMany(targetEntity = JpaSoftwareModule.class, fetch = FetchType.LAZY)
|
||||
@JoinTable(
|
||||
name = "sp_ds_module",
|
||||
joinColumns = {
|
||||
@@ -99,7 +99,7 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_module_module")) })
|
||||
private Set<SoftwareModule> modules;
|
||||
|
||||
@ManyToMany(cascade = { CascadeType.REMOVE }, targetEntity = JpaDistributionSetTag.class)
|
||||
@ManyToMany(targetEntity = JpaDistributionSetTag.class)
|
||||
@JoinTable(
|
||||
name = "sp_ds_dstag",
|
||||
joinColumns = {
|
||||
|
||||
@@ -105,7 +105,7 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
||||
|
||||
@ToString.Exclude
|
||||
@Getter(AccessLevel.NONE)
|
||||
@ManyToMany(mappedBy = "modules", targetEntity = JpaDistributionSet.class, fetch = FetchType.LAZY, cascade = { CascadeType.REMOVE })
|
||||
@ManyToMany(mappedBy = "modules", targetEntity = JpaDistributionSet.class, fetch = FetchType.LAZY)
|
||||
private List<DistributionSet> assignedTo;
|
||||
|
||||
/**
|
||||
|
||||
@@ -151,7 +151,7 @@ public class JpaTarget extends AbstractJpaNamedEntity implements Target, EventAw
|
||||
@JoinColumn(name = "target_type", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_relation_target_type"))
|
||||
private TargetType targetType;
|
||||
|
||||
@ManyToMany(cascade = { CascadeType.REMOVE }, targetEntity = JpaTargetTag.class)
|
||||
@ManyToMany(targetEntity = JpaTargetTag.class)
|
||||
@JoinTable(
|
||||
name = "sp_target_target_tag",
|
||||
joinColumns = {
|
||||
|
||||
Reference in New Issue
Block a user