From a41ed87fae8bff48d1f3ed5ae34129a6d49d9c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Such=C3=A1nek?= Date: Sun, 12 Jan 2025 15:27:08 +0100 Subject: [PATCH] Fix metadata schema extends resolution --- .../fairdatapoint/service/schema/MetadataSchemaService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/fairdatapoint/service/schema/MetadataSchemaService.java b/src/main/java/org/fairdatapoint/service/schema/MetadataSchemaService.java index f5d0a912..284d425f 100644 --- a/src/main/java/org/fairdatapoint/service/schema/MetadataSchemaService.java +++ b/src/main/java/org/fairdatapoint/service/schema/MetadataSchemaService.java @@ -439,11 +439,11 @@ private List resolveExtends(List s final Map allSchemas = versionRepository .findAllByState(MetadataSchemaState.LATEST) .stream() - .collect(Collectors.toMap(MetadataSchemaVersion::getUuid, Function.identity())); + .collect(Collectors.toMap(MetadataSchemaVersion::extractSchemaUuid, Function.identity())); final Set addedSchemaUuids = new HashSet<>(); final List result = new ArrayList<>(); schemas.forEach(schema -> { - addedSchemaUuids.add(schema.getUuid()); + addedSchemaUuids.add(schema.extractSchemaUuid()); result.add(schema); }); int index = 0; @@ -585,7 +585,7 @@ public List importSchemas(List newSchemas = schemaRepository.saveAllAndFlush( + schemaRepository.saveAllAndFlush( reqDtos.stream() .map(MetadataSchemaVersionDTO::getUuid) .filter(uuid -> !toBePresentUuids.contains(uuid))