Case-insensitive equals using Hibernate Criteria

后端 未结 7 1471
旧时难觅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:13

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

    This did returns a SimpleExpression Object but It generates lower(firstname) query. So this works.

提交回复
热议问题