Using LIKE % in Hibernate

前端 未结 3 590
情歌与酒
情歌与酒 2021-01-22 00:05

How do I use LIKE % in Hibernate. I want to use a SQL with LIKE % in my hbm.xml file. I have 2 queries which I am consolidating to 1.

3条回答
  •  遇见更好的自我
    2021-01-22 00:39

    Use LIKE '%?%' and second parameter string to make the query. The field also should be a string type because like is used to compare strings.

提交回复
热议问题