Fixes bug on DMP finalize when no Datasets where to be Canceled.

This commit is contained in:
gkolokythas 2019-06-24 17:59:51 +03:00
parent 46042b7403
commit f07384ed42
1 changed files with 16 additions and 12 deletions

View File

@ -437,6 +437,7 @@ public class DataManagementPlanManager {
datasetsToBeCanceled.add(dataset.getId());
}
}
if (!datasetsToBeCanceled.isEmpty())
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeCanceled))
.update(root -> root.<Integer>get("status"), Dataset.Status.CANCELED.getValue());
@ -447,6 +448,7 @@ public class DataManagementPlanManager {
datasetsToBeCanceled.add(dataset.getId());
}
}
if (!datasetsToBeCanceled.isEmpty())
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeCanceled))
.update(root -> root.<Integer>get("status"), Dataset.Status.CANCELED.getValue());
@ -468,6 +470,7 @@ public class DataManagementPlanManager {
datasetsToBeCanceled.add(UUID.fromString(dataset.getId()));
}
}
if (!datasetsToBeCanceled.isEmpty())
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeCanceled))
.update(root -> root.<Integer>get("status"), Dataset.Status.CANCELED.getValue());
@ -478,6 +481,7 @@ public class DataManagementPlanManager {
datasetsToBeCanceled.add(UUID.fromString(dataset.getId()));
}
}
if (!datasetsToBeCanceled.isEmpty())
apiContext.getOperationsContext().getDatabaseRepository().getDatasetDao()
.asQueryable().where((builder, root) -> root.get("id").in(datasetsToBeCanceled))
.update(root -> root.<Integer>get("status"), Dataset.Status.CANCELED.getValue());