Loading dmp-backend/data/src/main/java/eu/eudat/data/entities/Dataset.java +31 −10 Original line number Diff line number Diff line Loading @@ -281,19 +281,40 @@ public class Dataset implements DataEntity<Dataset, UUID> { this.setLabel(entity.getLabel()); this.setProperties(entity.getProperties()); if (entity.getDatasetDataRepositories() == null || entity.getDatasetDataRepositories().size() < 1) { if (this.getDatasetDataRepositories() != null) this.getDatasetDataRepositories().removeAll(this.getDatasetDataRepositories()); } else { if (this.getDatasetDataRepositories() != null) { this.getDatasetDataRepositories().removeAll(this.getDatasetDataRepositories()); if (entity.getDatasetDataRepositories() != null) this.getDatasetDataRepositories().addAll(entity.getDatasetDataRepositories()); } else { this.setDatasetDataRepositories(new HashSet<>()); } this.getDatasetDataRepositories().addAll(entity.getDatasetDataRepositories().stream().peek(item -> item.setDataset(this)).collect(Collectors.toList())); } if (entity.getDatasetExternalDatasets() == null || entity.getDatasetExternalDatasets().size() < 1) { if (this.getDatasetExternalDatasets() != null) this.getDatasetExternalDatasets().removeAll(this.getDatasetExternalDatasets()); } else { if (this.getDatasetExternalDatasets() != null) { this.getDatasetExternalDatasets().removeAll(this.getDatasetExternalDatasets()); if (entity.getDatasetExternalDatasets() != null) this.getDatasetExternalDatasets().addAll(entity.getDatasetExternalDatasets()); this.setRegistries(entity.getRegistries()); } else { this.setDatasetExternalDatasets(new HashSet<>()); } this.getDatasetExternalDatasets().addAll(entity.getDatasetExternalDatasets().stream().peek(item -> item.setDataset(this)).collect(Collectors.toList())); } if (entity.getServices() == null || entity.getServices().size() < 1) { if (this.getServices() != null) this.getServices().removeAll(this.getServices()); } else { if (this.getServices() != null) { this.getServices().removeAll(this.getServices()); if (entity.getServices() != null) this.getServices().addAll(entity.getServices()); } else { this.setServices(new HashSet<>()); } this.getServices().addAll(entity.getServices().stream().peek(item -> item.setDataset(this)).collect(Collectors.toList())); } this.setRegistries(entity.getRegistries()); this.setDmp(entity.getDmp()); this.setStatus(entity.getStatus()); Loading Loading
dmp-backend/data/src/main/java/eu/eudat/data/entities/Dataset.java +31 −10 Original line number Diff line number Diff line Loading @@ -281,19 +281,40 @@ public class Dataset implements DataEntity<Dataset, UUID> { this.setLabel(entity.getLabel()); this.setProperties(entity.getProperties()); if (entity.getDatasetDataRepositories() == null || entity.getDatasetDataRepositories().size() < 1) { if (this.getDatasetDataRepositories() != null) this.getDatasetDataRepositories().removeAll(this.getDatasetDataRepositories()); } else { if (this.getDatasetDataRepositories() != null) { this.getDatasetDataRepositories().removeAll(this.getDatasetDataRepositories()); if (entity.getDatasetDataRepositories() != null) this.getDatasetDataRepositories().addAll(entity.getDatasetDataRepositories()); } else { this.setDatasetDataRepositories(new HashSet<>()); } this.getDatasetDataRepositories().addAll(entity.getDatasetDataRepositories().stream().peek(item -> item.setDataset(this)).collect(Collectors.toList())); } if (entity.getDatasetExternalDatasets() == null || entity.getDatasetExternalDatasets().size() < 1) { if (this.getDatasetExternalDatasets() != null) this.getDatasetExternalDatasets().removeAll(this.getDatasetExternalDatasets()); } else { if (this.getDatasetExternalDatasets() != null) { this.getDatasetExternalDatasets().removeAll(this.getDatasetExternalDatasets()); if (entity.getDatasetExternalDatasets() != null) this.getDatasetExternalDatasets().addAll(entity.getDatasetExternalDatasets()); this.setRegistries(entity.getRegistries()); } else { this.setDatasetExternalDatasets(new HashSet<>()); } this.getDatasetExternalDatasets().addAll(entity.getDatasetExternalDatasets().stream().peek(item -> item.setDataset(this)).collect(Collectors.toList())); } if (entity.getServices() == null || entity.getServices().size() < 1) { if (this.getServices() != null) this.getServices().removeAll(this.getServices()); } else { if (this.getServices() != null) { this.getServices().removeAll(this.getServices()); if (entity.getServices() != null) this.getServices().addAll(entity.getServices()); } else { this.setServices(new HashSet<>()); } this.getServices().addAll(entity.getServices().stream().peek(item -> item.setDataset(this)).collect(Collectors.toList())); } this.setRegistries(entity.getRegistries()); this.setDmp(entity.getDmp()); this.setStatus(entity.getStatus()); Loading