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
|
@NotNull
|
||||||
private DistributionSetType type;
|
private DistributionSetType type;
|
||||||
|
|
||||||
@ManyToMany(targetEntity = JpaSoftwareModule.class, fetch = FetchType.LAZY, cascade = { CascadeType.REMOVE })
|
@ManyToMany(targetEntity = JpaSoftwareModule.class, fetch = FetchType.LAZY)
|
||||||
@JoinTable(
|
@JoinTable(
|
||||||
name = "sp_ds_module",
|
name = "sp_ds_module",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@@ -99,7 +99,7 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
|||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_module_module")) })
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_module_module")) })
|
||||||
private Set<SoftwareModule> modules;
|
private Set<SoftwareModule> modules;
|
||||||
|
|
||||||
@ManyToMany(cascade = { CascadeType.REMOVE }, targetEntity = JpaDistributionSetTag.class)
|
@ManyToMany(targetEntity = JpaDistributionSetTag.class)
|
||||||
@JoinTable(
|
@JoinTable(
|
||||||
name = "sp_ds_dstag",
|
name = "sp_ds_dstag",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
|||||||
|
|
||||||
@ToString.Exclude
|
@ToString.Exclude
|
||||||
@Getter(AccessLevel.NONE)
|
@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;
|
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"))
|
@JoinColumn(name = "target_type", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_relation_target_type"))
|
||||||
private TargetType targetType;
|
private TargetType targetType;
|
||||||
|
|
||||||
@ManyToMany(cascade = { CascadeType.REMOVE }, targetEntity = JpaTargetTag.class)
|
@ManyToMany(targetEntity = JpaTargetTag.class)
|
||||||
@JoinTable(
|
@JoinTable(
|
||||||
name = "sp_target_target_tag",
|
name = "sp_target_target_tag",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
|
|||||||
Reference in New Issue
Block a user