`

Restrictions 使用

阅读更多
Restrictions:
  like的使用:

匹配模式结合使用:

MatchMode.EXACT --> 字符串精确匹配.相当于"like 'value'(该种情况不推荐使用)

MatchMode.ANYWHERE   like  '%value%'

MatchMode.START  LIKE 'VALUE%'  字符串匹配在前

MatchMode.END LIKE '%VALUE'   字符串匹配在后

(Restrictions.like("description", key,MatchMode.ANYWHERE

Restrictions直接写sql:
Restrictions.sqlRestriction("sql");


Restrictions not  : 逻辑非
not between x and y  Restrictions.not(Restrictions..between()) 小于值X或者大于值y



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics