//查找产品名称里包含abc的产品
Criteria criteria = session.createCriteria(Product.class); criteria.add(Restrictions.like("name", "%abc%")); l = criteria.list();
product表里明明有名称包含abc的产品。
ringa_lee
The reason why the query cannot be found is because the Oracle database is case-sensitive by default.
Solution:
criteria.add(Restrictions.like("name", "%abc%").ignoreCase());
The reason why the query cannot be found is because the Oracle database is case-sensitive by default.
Solution: