diff options
Diffstat (limited to 'mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java index 94c57945d1..eaeb4292fb 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java @@ -28,14 +28,18 @@ import org.springframework.stereotype.Repository; @Repository public interface NetworkResourceRepository extends JpaRepository<NetworkResource, String> { - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelName - * @return - */ - @Query(value = "SELECT * FROM network_resource WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - NetworkResource findFirstByModelNameOrderByModelVersionDesc(String modelName); - - NetworkResource findResourceByModelUUID(String modelUUID); - NetworkResource findOneByModelName(String modelName); + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelName + * @return + */ + @Query(value = "SELECT * FROM network_resource WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + NetworkResource findFirstByModelNameOrderByModelVersionDesc(String modelName); + + NetworkResource findResourceByModelUUID(String modelUUID); + + NetworkResource findOneByModelName(String modelName); } |