+
+ private static SchemaSet toSchemaSet(final SchemaSetEntity schemaSetEntity) {
+ return SchemaSet.builder().name(schemaSetEntity.getName())
+ .dataspaceName(schemaSetEntity.getDataspace().getName()).build();
+ }
+
+ private void storeAndLinkNewModules(final Map<String, String> newModuleNameToContentMap,
+ final SchemaSetEntity schemaSetEntity) {
+ final Set<YangResourceEntity> yangResourceEntities
+ = new HashSet<>(synchronizeYangResources(newModuleNameToContentMap));
+ schemaSetEntity.setYangResources(yangResourceEntities);
+ schemaSetRepository.save(schemaSetEntity);
+ }
+
+ private void updateAllModuleReferences(final Collection<ModuleReference> allModuleReferences,
+ final Integer schemaSetEntityId) {
+ yangResourceRepository.deleteSchemaSetYangResourceForSchemaSetId(schemaSetEntityId);
+ final List<Integer> allYangResourceIds =
+ yangResourceRepository.getResourceIdsByModuleReferences(allModuleReferences);
+ yangResourceRepository.insertSchemaSetIdYangResourceId(schemaSetEntityId, allYangResourceIds);
+ }
+