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


##########
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:
   @ganning127, can we convert to lower-case and check similar to line 70



-- 
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: issues-unsubscr...@airavata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to