diff options
Diffstat (limited to 'mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java index 25b1757185..6d432c443c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java @@ -20,15 +20,14 @@ package org.onap.so.db.catalog.data.repository; -import java.util.List; - import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.data.projections.InlineService; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; +import java.util.List; + @RepositoryRestResource(collectionResourceRel = "service", path = "service", excerptProjection = InlineService.class) public interface ServiceRepository extends JpaRepository<Service, String> { List<Service> findByModelName(String modelName); @@ -41,7 +40,7 @@ public interface ServiceRepository extends JpaRepository<Service, String> { * @return */ @Query(value = "SELECT * FROM service WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - Service findFirstByModelNameOrderByModelVersionDesc(@Param("MODEL_NAME") String modelName); + Service findFirstByModelNameOrderByModelVersionDesc(String modelName); /** * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting @@ -73,8 +72,7 @@ public interface ServiceRepository extends JpaRepository<Service, String> { @Query(value = "SELECT * FROM service WHERE MODEL_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) Service findOneByModelUUIDOrderByModelVersionDesc(String modelUUID); - Service findByModelVersionAndModelInvariantUUID(@Param("MODEL_VERSION") String modelVersion, - @Param("MODEL_INVARIANT_UUID") String modelInvariantUUID); + Service findFirstByModelVersionAndModelInvariantUUID(String modelVersion, String modelInvariantUUID); /** * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting @@ -90,9 +88,9 @@ public interface ServiceRepository extends JpaRepository<Service, String> { /** * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelInvariantId + * @param modelInvariantUUID * @return */ @Query(value = "SELECT * FROM service WHERE MODEL_INVARIANT_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC;", nativeQuery = true) - List<Service> findByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantId); + List<Service> findByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID); }
\ No newline at end of file |