ganning127 commented on code in PR #520:
URL: https://github.com/apache/airavata/pull/520#discussion_r2151296000


##########
modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/repo/ResourceRepository.java:
##########
@@ -31,31 +31,44 @@
 @Repository
 public interface ResourceRepository extends JpaRepository<Resource, String> {
 
-    @Query("SELECT r FROM #{#entityName} r WHERE TYPE(r) IN :types")
-    Page<Resource> findAllByTypes(@Param("types") List<Class<? extends 
Resource>> types, Pageable pageable);
+    @Query(
+            """
+            SELECT r
+            FROM #{#entityName} r
+            WHERE TYPE(r) IN :types AND r.name LIKE CONCAT('%', :nameSearch, 
'%')
+            ORDER BY r.name
+            """)
+    Page<Resource> findAllByTypes(
+            @Param("types") List<Class<? extends Resource>> types,
+            @Param("nameSearch") String nameSearch,
+            Pageable pageable);
 
     @Query(
             """
-    SELECT r
-    FROM Resource r
-    JOIN r.tags t
-    WHERE r.class IN :typeList AND t.value IN :tags
-    GROUP BY r
-    HAVING COUNT(DISTINCT t.value) = :tagCount
-    """)
+            SELECT r
+            FROM Resource r
+            JOIN r.tags t
+            WHERE r.class IN :typeList
+              AND t.value IN :tags
+              AND r.name LIKE CONCAT('%', :nameSearch, '%')

Review Comment:
   Just pushed a fix!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to