hibernate查询条件表达式Restrictions

主要是从官网上拔下来的例子:

官网链接:http://docs.jboss.org/hibernate/orm/3.5/javadocs/org/hibernate/criterion/Restrictions.html

static Criterion	allEq(Map propertyNameValues) 
          Apply an "equals" constraint to each property in the key set of a Map
static LogicalExpression	and(Criterion lhs, Criterion rhs) 
          Return the conjuction of two expressions
static Criterion	between(String propertyName, Object lo, Object hi) 
          Apply a "between" constraint to the named property
static Conjunction	conjunction() 
          Group expressions together in a single conjunction (A and B and C...)
static Disjunction	disjunction() 
          Group expressions together in a single disjunction (A or B or C...)
static SimpleExpression	eq(String propertyName, Object value) 
          Apply an "equal" constraint to the named property
static PropertyExpression	eqProperty(String propertyName, String otherPropertyName) 
          Apply an "equal" constraint to two properties
static SimpleExpression	ge(String propertyName, Object value) 
          Apply a "greater than or equal" constraint to the named property
static PropertyExpression	geProperty(String propertyName, String otherPropertyName) 
          Apply a "greater than or equal" constraint to two properties
static SimpleExpression	gt(String propertyName, Object value) 
          Apply a "greater than" constraint to the named property
static PropertyExpression	gtProperty(String propertyName, String otherPropertyName) 
          Apply a "greater than" constraint to two properties
static Criterion	idEq(Object value) 
          Apply an "equal" constraint to the identifier property
static Criterion	ilike(String propertyName, Object value) 
          A case-insensitive "like", similar to Postgres ilike operator
static Criterion	ilike(String propertyName, String value, MatchMode matchMode) 
          A case-insensitive "like", similar to Postgres ilike operator
static Criterion	in(String propertyName, Collection values) 
          Apply an "in" constraint to the named property
static Criterion	in(String propertyName, Object[] values) 
          Apply an "in" constraint to the named property
static Criterion	isEmpty(String propertyName) 
          Constrain a collection valued property to be empty
static Criterion	isNotEmpty(String propertyName) 
          Constrain a collection valued property to be non-empty
static Criterion	isNotNull(String propertyName) 
          Apply an "is not null" constraint to the named property
static Criterion	isNull(String propertyName) 
          Apply an "is null" constraint to the named property
static SimpleExpression	le(String propertyName, Object value) 
          Apply a "less than or equal" constraint to the named property
static PropertyExpression	leProperty(String propertyName, String otherPropertyName) 
          Apply a "less than or equal" constraint to two properties
static SimpleExpression	like(String propertyName, Object value) 
          Apply a "like" constraint to the named property
static SimpleExpression	like(String propertyName, String value, MatchMode matchMode) 
          Apply a "like" constraint to the named property
static SimpleExpression	lt(String propertyName, Object value) 
          Apply a "less than" constraint to the named property
static PropertyExpression	ltProperty(String propertyName, String otherPropertyName) 
          Apply a "less than" constraint to two properties
static NaturalIdentifier	naturalId() 
           
static SimpleExpression	ne(String propertyName, Object value) 
          Apply a "not equal" constraint to the named property
static PropertyExpression	neProperty(String propertyName, String otherPropertyName) 
          Apply a "not equal" constraint to two properties
static Criterion	not(Criterion expression) 
          Return the negation of an expression
static LogicalExpression	or(Criterion lhs, Criterion rhs) 
          Return the disjuction of two expressions
static Criterion	sizeEq(String propertyName, int size) 
          Constrain a collection valued property by size
static Criterion	sizeGe(String propertyName, int size) 
          Constrain a collection valued property by size
static Criterion	sizeGt(String propertyName, int size) 
          Constrain a collection valued property by size
static Criterion	sizeLe(String propertyName, int size) 
          Constrain a collection valued property by size
static Criterion	sizeLt(String propertyName, int size) 
          Constrain a collection valued property by size
static Criterion	sizeNe(String propertyName, int size) 
          Constrain a collection valued property by size
static Criterion	sqlRestriction(String sql) 
          Apply a constraint expressed in SQL.
static Criterion	sqlRestriction(String sql, Object[] values, Type[] types) 
          Apply a constraint expressed in SQL, with the given JDBC parameters.
static Criterion	sqlRestriction(String sql, Object value, Type type) 
          Apply a constraint expressed in SQL, with the given JDBC parameter.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值