hibernate查询条件表达式Restrictions

来源:互联网 发布:河北省人工智能学会 编辑:程序博客网 时间:2024/05/22 02:22

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

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

static CriterionallEq(Map propertyNameValues)           Apply an "equals" constraint to each property in the key set of a Mapstatic LogicalExpressionand(Criterion lhs, Criterion rhs)           Return the conjuction of two expressionsstatic Criterionbetween(String propertyName, Object lo, Object hi)           Apply a "between" constraint to the named propertystatic Conjunctionconjunction()           Group expressions together in a single conjunction (A and B and C...)static Disjunctiondisjunction()           Group expressions together in a single disjunction (A or B or C...)static SimpleExpressioneq(String propertyName, Object value)           Apply an "equal" constraint to the named propertystatic PropertyExpressioneqProperty(String propertyName, String otherPropertyName)           Apply an "equal" constraint to two propertiesstatic SimpleExpressionge(String propertyName, Object value)           Apply a "greater than or equal" constraint to the named propertystatic PropertyExpressiongeProperty(String propertyName, String otherPropertyName)           Apply a "greater than or equal" constraint to two propertiesstatic SimpleExpressiongt(String propertyName, Object value)           Apply a "greater than" constraint to the named propertystatic PropertyExpressiongtProperty(String propertyName, String otherPropertyName)           Apply a "greater than" constraint to two propertiesstatic CriterionidEq(Object value)           Apply an "equal" constraint to the identifier propertystatic Criterionilike(String propertyName, Object value)           A case-insensitive "like", similar to Postgres ilike operatorstatic Criterionilike(String propertyName, String value, MatchMode matchMode)           A case-insensitive "like", similar to Postgres ilike operatorstatic Criterionin(String propertyName, Collection values)           Apply an "in" constraint to the named propertystatic Criterionin(String propertyName, Object[] values)           Apply an "in" constraint to the named propertystatic CriterionisEmpty(String propertyName)           Constrain a collection valued property to be emptystatic CriterionisNotEmpty(String propertyName)           Constrain a collection valued property to be non-emptystatic CriterionisNotNull(String propertyName)           Apply an "is not null" constraint to the named propertystatic CriterionisNull(String propertyName)           Apply an "is null" constraint to the named propertystatic SimpleExpressionle(String propertyName, Object value)           Apply a "less than or equal" constraint to the named propertystatic PropertyExpressionleProperty(String propertyName, String otherPropertyName)           Apply a "less than or equal" constraint to two propertiesstatic SimpleExpressionlike(String propertyName, Object value)           Apply a "like" constraint to the named propertystatic SimpleExpressionlike(String propertyName, String value, MatchMode matchMode)           Apply a "like" constraint to the named propertystatic SimpleExpressionlt(String propertyName, Object value)           Apply a "less than" constraint to the named propertystatic PropertyExpressionltProperty(String propertyName, String otherPropertyName)           Apply a "less than" constraint to two propertiesstatic NaturalIdentifiernaturalId()            static SimpleExpressionne(String propertyName, Object value)           Apply a "not equal" constraint to the named propertystatic PropertyExpressionneProperty(String propertyName, String otherPropertyName)           Apply a "not equal" constraint to two propertiesstatic Criterionnot(Criterion expression)           Return the negation of an expressionstatic LogicalExpressionor(Criterion lhs, Criterion rhs)           Return the disjuction of two expressionsstatic CriterionsizeEq(String propertyName, int size)           Constrain a collection valued property by sizestatic CriterionsizeGe(String propertyName, int size)           Constrain a collection valued property by sizestatic CriterionsizeGt(String propertyName, int size)           Constrain a collection valued property by sizestatic CriterionsizeLe(String propertyName, int size)           Constrain a collection valued property by sizestatic CriterionsizeLt(String propertyName, int size)           Constrain a collection valued property by sizestatic CriterionsizeNe(String propertyName, int size)           Constrain a collection valued property by sizestatic CriterionsqlRestriction(String sql)           Apply a constraint expressed in SQL.static CriterionsqlRestriction(String sql, Object[] values, Type[] types)           Apply a constraint expressed in SQL, with the given JDBC parameters.static CriterionsqlRestriction(String sql, Object value, Type type)           Apply a constraint expressed in SQL, with the given JDBC parameter.


0 0