%Like% Query in spring JpaRepository

前端 未结 10 1670
南方客
南方客 2020-12-04 11:36

I would like to write a like query in JpaRepository but it is not returning anything :

LIKE \'%place%\'-its not working.

LIKE

10条回答
  •  遥遥无期
    2020-12-04 11:40

    You dont actually need the @Query annotation at all.

    You can just use the following

        @Repository("registerUserRepository")
        public interface RegisterUserRepository extends JpaRepository{
    
        List findByPlaceIgnoreCaseContaining(String place);
    
        }
    

提交回复
热议问题