diff options
Diffstat (limited to 'cps-ri/src/main/java')
3 files changed, 6 insertions, 6 deletions
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java index 032745b5ee..7a864a9216 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java @@ -1,7 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2020 Pantheon.tech - * Modifications Copyright (C) 2021 Nordix Foundation + * Modifications Copyright (C) 2021-2022 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ public class YangResourceEntity implements Serializable { @NotNull @Column - private String name; + private String fileName; @NotNull @Column diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index 117cb43b4f..9443355981 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -263,7 +263,7 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService final SchemaSetEntity schemaSetEntity = fragmentEntity.getAnchor().getSchemaSet(); final Map<String, String> yangResourceNameToContent = schemaSetEntity.getYangResources().stream().collect( - Collectors.toMap(YangResourceEntity::getName, YangResourceEntity::getContent)); + Collectors.toMap(YangResourceEntity::getFileName, YangResourceEntity::getContent)); final SchemaContext schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourceNameToContent) .getSchemaContext(); return schemaContext.getModules().iterator().next().getName(); diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java index 806e7ccaba..647d6cdefb 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java @@ -96,7 +96,7 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ final var schemaSetEntity = schemaSetRepository.getByDataspaceAndName(dataspaceEntity, schemaSetName); return schemaSetEntity.getYangResources().stream().collect( - Collectors.toMap(YangResourceEntity::getName, YangResourceEntity::getContent)); + Collectors.toMap(YangResourceEntity::getFileName, YangResourceEntity::getContent)); } @Override @@ -203,7 +203,7 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ final Map<String, String> moduleNameAndRevisionMap = createModuleNameAndRevisionMap(entry.getKey(), entry.getValue()); final var yangResourceEntity = new YangResourceEntity(); - yangResourceEntity.setName(entry.getKey()); + yangResourceEntity.setFileName(entry.getKey()); yangResourceEntity.setContent(entry.getValue()); yangResourceEntity.setModuleName(moduleNameAndRevisionMap.get("moduleName")); yangResourceEntity.setRevision(moduleNameAndRevisionMap.get("revision")); @@ -328,7 +328,7 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ yangResourceEntities.stream() .filter(entity -> StringUtils.equals(checksum, (entity.getChecksum()))) .findFirst() - .map(YangResourceEntity::getName) + .map(YangResourceEntity::getFileName) .orElse(null); } |