Case-insensitive equals using Hibernate Criteria

后端 未结 7 1478
旧时难觅i
旧时难觅i 2021-01-31 13:32

I\'ve seen Restrictions.ilike(\'property\', \'%value%\'), but would like to generate SQL like: lower(property) = \'value\'. Any ideas?

I used:

Restri         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 14:29

    Expression is now deprecated. Use Restrictions instead ...

    crit(Restrictions.eq("firstName", firstName).ignoreCase());
    

提交回复
热议问题