• 关于Hibernate中Restricted常用的限定查询条件


    关于hibernate中常用限定条件的记录:

    Restrictions.eq           equal,等于.

    Restrictions.allEq        参数为Map对象,使用key/value进行多个等于的比对,相当于多个Restrictions.eq 的效果

    Restrictions.gt           great-than > 大于

    Restrictions.ge           great-equal >= 大于等于

    Restrictions.lt           less-than, < 小于

    Restrictions.le           less-equal <= 小于等于

    Restrictions.between      对应SQL的between子句

    Restrictions.like         对应SQL的LIKE子句

    Restrictions.in           对应SQL的in子句

    Restrictions.and          and 关系

    Restrictions.or           or 关系

    Restrictions.isNull       判断属性是否为空,为空则返回true

    Restrictions.isNotNull    与isNull相反

    Restrictions.sqlRestriction    SQL限定的查询

    Order.asc                 根据传入的字段进行升序排序

    Order.desc                根据传入的字段进行降序排序

    MatchMode.EXACT           字符串精确匹配.相当于"like 'value'"

    MatchMode.ANYWHERE        字符串在中间匹配.相当于"like '%value%'"

    MatchMode.START           字符串在最前面的位置.相当于"like 'value%'"

    MatchMode.END             字符串在最后面的位置.相当于"like '%value'"
    ---------------------

    转载自:
    作者:aa675890430
    来源:CSDN
    原文:https://blog.csdn.net/aa675890430/article/details/39472875 

  • 相关阅读:
    设计模式C++描述----15.策略(Strategy)模式
    设计模式C++描述----14.外观(Facade)模式
    设计模式C++描述----12.享元(Flyweight)模式
    设计模式C++描述----13.代理(Proxy)模式
    设计模式C++描述----11.组合(Composite)模式
    设计模式C++描述----10.装饰(Decorator)模式
    爬虫之urllib包以及request模块和parse模块
    爬虫简介
    爬虫知识总汇
    Django之admin的使用和源码剖析
  • 原文地址:https://www.cnblogs.com/jinsheng1027/p/11274202.html
Copyright © 2020-2023  润新知