Hibernate Criteria, Integer and “like”

杀马特。学长 韩版系。学妹 提交于 2019-12-01 16:41:24

You could use the str expression conversion. If this makes any sense.

str() for converting numeric or temporal values to a readable string

session.createQuery("from P1 where str(id) like :id").setString("id", "%"+s+"%")

This will be quite slow if you do not have a function based index on the column.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!