Fix @ManyToMany to be hibernate compatible (#2116)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -85,18 +85,16 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
|||||||
@NotNull
|
@NotNull
|
||||||
private DistributionSetType type;
|
private DistributionSetType type;
|
||||||
|
|
||||||
@ManyToMany(
|
@ManyToMany(targetEntity = JpaSoftwareModule.class, fetch = FetchType.LAZY)
|
||||||
targetEntity = JpaSoftwareModule.class, fetch = FetchType.LAZY,
|
|
||||||
cascade = { CascadeType.PERSIST, CascadeType.MERGE })
|
|
||||||
@JoinTable(
|
@JoinTable(
|
||||||
name = "sp_ds_module",
|
name = "sp_ds_module",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "ds_id", nullable = false, insertable = false, updatable = false,
|
name = "ds_id", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_module_ds")) },
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_module_ds")) },
|
||||||
inverseJoinColumns = {
|
inverseJoinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "module_id", nullable = false, insertable = false, updatable = false,
|
name = "module_id", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_module_module")) })
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_module_module")) })
|
||||||
private Set<SoftwareModule> modules = new HashSet<>();
|
private Set<SoftwareModule> modules = new HashSet<>();
|
||||||
|
|
||||||
@@ -105,11 +103,11 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
|||||||
name = "sp_ds_dstag",
|
name = "sp_ds_dstag",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "ds", nullable = false, insertable = false, updatable = false,
|
name = "ds", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_dstag_ds")) },
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_dstag_ds")) },
|
||||||
inverseJoinColumns = {
|
inverseJoinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "TAG", nullable = false, insertable = false, updatable = false,
|
name = "TAG", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_dstag_tag")) })
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_dstag_tag")) })
|
||||||
private Set<DistributionSetTag> tags = new HashSet<>();
|
private Set<DistributionSetTag> tags = new HashSet<>();
|
||||||
|
|
||||||
|
|||||||
@@ -162,11 +162,11 @@ public class JpaTarget extends AbstractJpaNamedEntity implements Target, EventAw
|
|||||||
name = "sp_target_target_tag",
|
name = "sp_target_target_tag",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "target", nullable = false, insertable = false, updatable = false,
|
name = "target", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target")) },
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target")) },
|
||||||
inverseJoinColumns = {
|
inverseJoinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "tag", nullable = false, insertable = false, updatable = false,
|
name = "tag", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag"))
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag"))
|
||||||
})
|
})
|
||||||
private Set<TargetTag> tags;
|
private Set<TargetTag> tags;
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ public class JpaTargetType extends AbstractJpaTypeEntity implements TargetType,
|
|||||||
name = "sp_target_type_ds_type_relation",
|
name = "sp_target_type_ds_type_relation",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "target_type", nullable = false, insertable = false, updatable = false,
|
name = "target_type", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_type_relation_target_type")) },
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_type_relation_target_type")) },
|
||||||
inverseJoinColumns = {
|
inverseJoinColumns = {
|
||||||
@JoinColumn(
|
@JoinColumn(
|
||||||
name = "distribution_set_type", nullable = false, insertable = false, updatable = false,
|
name = "distribution_set_type", nullable = false,
|
||||||
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_type_relation_ds_type")) })
|
foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_target_type_relation_ds_type")) })
|
||||||
private Set<DistributionSetType> distributionSetTypes = new HashSet<>();
|
private Set<DistributionSetType> distributionSetTypes = new HashSet<>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user