Spring Data - Multi-column searches

前端 未结 5 1972
心在旅途
心在旅途 2020-12-01 10:05

I am using Spring Data for the paging and the sorting. However, I would like to perform multi-columns searches.

Now, I am using the annotation @Query in my r

5条回答
  •  悲&欢浪女
    2020-12-01 10:29

    You could use specifications. That also gives you more flexibility. You can have one method, but use multiple specifications for a query:

    Page findAll(Specification spec, Pageable pageable);
    
    myRepository.findAll(textInAllColumns(searchText), pageable);
    

提交回复
热议问题