diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java index 50462c163..5df4bdf88 100644 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java +++ b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetDaoImpl.java @@ -35,9 +35,9 @@ public class DatasetDaoImpl extends DatabaseAccess implements DatasetDa if (criteria.getIsPublic() != null && criteria.getIsPublic()) { query.where((builder, root) -> builder.equal(root.get("dmp").get("isPublic"), true)); query.where((builder, root) -> builder.equal(root.get("status"), Dataset.Status.FINALISED.getValue())); - query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"), + /*query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"), query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")), - Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class))); + Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class)));*/ } if (criteria.getLike() != null && !criteria.getLike().isEmpty()) query.where((builder, root) -> builder.or( diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java index 6b13dc058..1e3443a4d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java @@ -182,8 +182,9 @@ public class DataManagementPlanManager { dataTable.setData(dmps1.stream().map(dmp -> { DatasetCriteria datasetCriteria = new DatasetCriteria(); datasetCriteria.setDmpIds(Collections.singletonList(dmp.getId())); - datasetCriteria.setAllVersions(false); + datasetCriteria.setAllVersions(dataManagementPlanTableRequest.getCriteria().getAllVersions()); datasetCriteria.setIsPublic(dataManagementPlanTableRequest.getCriteria().getIsPublic()); + datasetCriteria.setGroupIds(Collections.singletonList(dmp.getGroupId())); dmp.setDataset(retrieveRelevantDatasets(datasetCriteria, principalID)); @@ -207,6 +208,8 @@ public class DataManagementPlanManager { DatasetCriteria datasetCriteria = new DatasetCriteria(); datasetCriteria.setDmpIds(Collections.singletonList(dmp.getId())); datasetCriteria.setIsPublic(true); + datasetCriteria.setAllVersions(dataManagementPlanTableRequest.getCriteria().getAllVersions()); + datasetCriteria.setGroupIds(Collections.singletonList(dmp.getGroupId())); dmp.setDataset(retrieveRelevantDatasets(datasetCriteria));