QBC运算符含义

HQL运算符                   QBC运算符                      含义

=                     Restrictions.eq()                  等于

<>                   Restrictions.not(Exprission.eq())  不等于

>                     Restrictions.gt()                  大于

>=                   Restrictions.ge()                  大于等于

<                     Restrictions.lt()                  小于

<=                   Restrictions.le()                  小于等于

is null             Restrictions.isnull()              等于空值

is not null      Restrictions.isNotNull()           非空值

like                 Restrictions.like()                字符串模式匹配

and                Restrictions.and()                 逻辑与

and                Restrictions.conjunction()         逻辑与

or                   Restrictions.or()                  逻辑或

or                   Restrictions.disjunction()         逻辑或

not                  Restrictions.not()                 逻辑非

in(列表)          Restrictions.in()                  等于列表中的某一个值

ont in(列表)         Restrictions.not(Restrictions.in())不等于列表中随意一个值

between x and y      Restrictions.between()             闭区间xy中的随意值

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

时间: 2024-08-05 23:24:41

QBC运算符含义的相关文章

Hibernate Restrictions QBC运算符

HQL运算符 QBC运算符 含义 = Restrictions.eq() 等于equal <>  Restrictions.ne() 不等于not equal >  Restrictions.gt() 大于greater than >= Restrictions.ge() 大于等于greater than or equal <  Restrictions.lt() 小于less than <= Restrictions.le() 小于等于less than or equ

Hibernate QBC运算符

HQL运算符 QBC运算符 含义 = Restrictions.eq() 等于equal <> Restrictions.ne() 不等于not   equal > Restrictions.gt() 大于greater   than >= Restrictions.ge() 大于等于greater   than or equal < Restrictions.lt() 小于less   than <= Restrictions.le() 小于等于less   than

QBC查询、离线条件查询(DetachedCriteric)和分页查询模版

一.QBC检索步骤 QBC检索步骤: 1.调用Session的createCriteria()方法创建一个Criteria对象. 2.设定查询条件.Expression类提供了一系列用于设定查询条件的静态方法, 这些静态方法都返回Criterion实例,每个Criterion实例代表一个查询条件. Criteria的add()方法用于加入查询条件. 3.调用Criteria的list()方法执行查询语句.该方法返回List类型的查询结果,在 List集合中存放了符合查询条件的持久化对象. 比较运

Nhibernate Query By Criteria 条件查询

HQL运算符 QBC运算符 含义 = Restrictions.eq() 等于equal <> Restrictions.ne() 不等于not equal > Restrictions.gt() 大于greater than >= Restrictions.ge() 大于等于greater than or equal < Restrictions.lt() 小于less than <= Restrictions.le() 小于等于less than or equal

Hibernate之Criteria的完整用法

Criteria的完整用法 QBE (Query By Example) Criteria cri = session.createCriteria(Student.class); cri.add(Example.create(s)); //s是一个Student对象 list cri.list(); 实质:创建一个模版,比如我有一个表serial有一个 giftortoy字段,我设置serial.setgifttoy("2"), 则这个表中的所有的giftortoy为2的数据都会出来

Hibernate Criteria

HQL运算符 QBC运算符 含义 = Restrictions.eq() 等于equal <>  Restrictions.ne() 不等于not equal >  Restrictions.gt() 大于greater than >= Restrictions.ge() 大于等于greater than or equal <  Restrictions.lt() 小于less than <= Restrictions.le() 小于等于less than or equ

Hibernate Restrictions 用法

Restrictions 用法 HQL运算符 QBC运算符 含义 = Restrictions.eq() 等于equal <>  Restrictions.ne() 不等于not equal >  Restrictions.gt() 大于greater than >= Restrictions.ge() 大于等于greater than or equal <  Restrictions.lt() 小于less than <= Restrictions.le() 小于等于

hibernate Criteria 使用

: QBE (Query By Example)    Criteria cri = session.createCriteria(Student.class);    cri.add(Example.create(s)); //s是一个Student对象    list cri.list();       实质:创建一个模版,比如我有一个表serial有一个 giftortoy字段,我设置serial.setgifttoy("2"),          则这个表中的所有的giftor

Restrictions用法

HQL运算符 QBC运算符 含义 = Restrictions.eq() 等于equal <>  Restrictions.ne() 不等于not equal >  Restrictions.gt() 大于greater than >= Restrictions.ge() 大于等于greater than or equal <  Restrictions.lt() 小于less than <= Restrictions.le() 小于等于less than or equ