/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Pantheon.tech
- * Modifications Copyright (C) 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.
+ "JOIN yang_resource ON yang_resource.id = schema_set_yang_resources.yang_resource_id\n"
+ "WHERE\n"
+ "dataspace.name = :dataspaceName", nativeQuery = true)
- Set<YangResourceModuleReference> findAllModuleReferences(@Param("dataspaceName") String dataspaceName);
+ Set<YangResourceModuleReference> findAllModuleReferencesByDataspace(@Param("dataspaceName") String dataspaceName);
@Query(value = "SELECT DISTINCT\n"
+ "yang_resource.module_Name AS module_name,\n"
+ "WHERE\n"
+ "dataspace.name = :dataspaceName AND\n"
+ "anchor.name =:anchorName", nativeQuery = true)
- Set<YangResourceModuleReference> findAllModuleReferences(
+ Set<YangResourceModuleReference> findAllModuleReferencesByDataspaceAndAnchor(
@Param("dataspaceName") String dataspaceName, @Param("anchorName") String anchorName);
@Query(value = "SELECT DISTINCT\n"
+ "JOIN yang_resource ON yang_resource.id = schema_set_yang_resources.yang_resource_id\n"
+ "WHERE\n"
+ "dataspace.name = :dataspaceName and yang_resource.module_Name IN (:moduleNames)", nativeQuery = true)
- Set<YangResourceModuleReference> findAllModuleReferences(@Param("dataspaceName") String dataspaceName,
- @Param("moduleNames") Collection<String> moduleNames);
+ Set<YangResourceModuleReference> findAllModuleReferencesByDataspaceAndModuleNames(
+ @Param("dataspaceName") String dataspaceName, @Param("moduleNames") Collection<String> moduleNames);
@Query(value = "SELECT id FROM yang_resource WHERE module_name=:name and revision=:revision", nativeQuery = true)