【发布时间】:2014-06-21 23:19:12
【问题描述】:
大家好,我需要在 hibernate 上实现一个标准搜索,它与字符串进行比较,并且仅当字符串与另一个字符串完全匹配时才返回 true,例如:
String x = "aa"; --> field of Class
String y = "Aa"; --> passed as argument method
Criteria crit = getSession()
.createCriteria(Class.class)
.add(Restrictions.like("x", "y")) --> same value for both string, but really its not the same, aa its not equals Aa.
我请客使用:
- 结果相同
- 匹配模式无效
这应该区分大小写。
谢谢
【问题讨论】:
-
您的数据库是否配置为区分大小写?
标签: java hibernate criteria hibernate-mapping