When cloning Datasets with external references properly get the DataRepository id and the ExternalDatatset id and copy the data from the original (ref #226)
This commit is contained in:
parent
15c256e7eb
commit
4e7e269130
|
@ -788,11 +788,12 @@ public class DataManagementPlanManager {
|
|||
if (newDataset.getDatasetDataRepositories() != null) {
|
||||
newDataset.setDatasetDataRepositories(newDataset.getDatasetDataRepositories().stream().map(item -> {
|
||||
DataRepository dataRepository = new DataRepository();
|
||||
dataRepository.setId(item.getId());
|
||||
dataRepository.setId(item.getDataRepository().getId());
|
||||
|
||||
DatasetDataRepository datasetDataRepository = new DatasetDataRepository();
|
||||
datasetDataRepository.setDataRepository(dataRepository);
|
||||
datasetDataRepository.setDataset(newDataset);
|
||||
datasetDataRepository.setData(item.getData());
|
||||
return datasetDataRepository;
|
||||
}).collect(Collectors.toSet()));
|
||||
}
|
||||
|
@ -800,10 +801,11 @@ public class DataManagementPlanManager {
|
|||
if (newDataset.getDatasetExternalDatasets() != null) {
|
||||
newDataset.setDatasetExternalDatasets(newDataset.getDatasetExternalDatasets().stream().map(item -> {
|
||||
ExternalDataset externalDataset = new ExternalDataset();
|
||||
externalDataset.setId(item.getId());
|
||||
externalDataset.setId(item.getExternalDataset().getId());
|
||||
DatasetExternalDataset datasetExternalDataset = new DatasetExternalDataset();
|
||||
datasetExternalDataset.setExternalDataset(externalDataset);
|
||||
datasetExternalDataset.setDataset(newDataset);
|
||||
datasetExternalDataset.setData(item.getData());
|
||||
return datasetExternalDataset;
|
||||
}).collect(Collectors.toSet()));
|
||||
}
|
||||
|
@ -823,6 +825,7 @@ public class DataManagementPlanManager {
|
|||
DatasetService datasetService = new DatasetService();
|
||||
datasetService.setService(service);
|
||||
datasetService.setDataset(newDataset);
|
||||
datasetService.setData(item.getData());
|
||||
return datasetService;
|
||||
}).collect(Collectors.toSet()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue