%Like% Query in spring JpaRepository

前端 未结 10 1676
南方客
南方客 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:46

    I use this:

    @Query("Select c from Registration c where lower(c.place) like lower(concat('%', concat(:place, '%')))")
    

    lower() is like toLowerCase in String, so the result isn't case sensitive.

提交回复
热议问题