[#1580] Software Module & Distribution Set lock: add lock at mgmt level (#1644)

Additionally,

* removed DistributionSet.getAutoAssignFilters and
* removed SoftwareModule.getAssignedTo both are not used and exposed via Mgmt API.

Maybe, if needed, they could be returned back along with exposing them via Mgmt API.

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-02-15 09:20:48 +02:00
committed by GitHub
parent 9bc0e74f47
commit 23ad6a140f
4 changed files with 71 additions and 79 deletions

View File

@@ -123,6 +123,7 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
private boolean requiredMigrationStep;
@ToString.Exclude
@Getter(AccessLevel.NONE)
@OneToMany(mappedBy = "autoAssignDistributionSet", targetEntity = JpaTargetFilterQuery.class, fetch = FetchType.LAZY)
private List<TargetFilterQuery> autoAssignFilters;

View File

@@ -88,6 +88,9 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
@Size(max = SoftwareModule.VENDOR_MAX_SIZE)
private String vendor;
@Column(name = "encrypted")
private boolean encrypted;
@ToString.Exclude
@CascadeOnDelete
@OneToMany(mappedBy = "softwareModule", fetch = FetchType.LAZY, targetEntity = JpaSoftwareModuleMetadata.class)
@@ -99,9 +102,6 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
@Column(name = "deleted")
private boolean deleted;
@Column(name = "encrypted")
private boolean encrypted;
@ToString.Exclude
@Getter(AccessLevel.NONE)
@CascadeOnDelete
@@ -190,15 +190,6 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
this.encrypted = encrypted;
}
@Override
public List<DistributionSet> getAssignedTo() {
if (assignedTo == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(assignedTo);
}
@Override
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(