Named Query with like in where clause

前端 未结 4 1132
无人及你
无人及你 2020-12-29 03:49

Is it possible to have a like in a where clause in a named query? I am trying to do the following but am getting exceptions

@NamedQuery(name = \"Place.getPla         


        
4条回答
  •  醉梦人生
    2020-12-29 03:58

    If you are using positional parameters, you can use this way

    @Query("select p from ABC p where p.name like CONCAT('%',?1,'%') ")
    

提交回复
热议问题