本文整理了Java中org.hibernate.criterion.Restrictions.sizeNe
方法的一些代码示例,展示了Restrictions.sizeNe
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Restrictions.sizeNe
方法的具体详情如下:
包路径:org.hibernate.criterion.Restrictions
类名称:Restrictions
方法名:sizeNe
[英]Constrain a collection valued property by size
[中]按大小约束集合值属性
代码示例来源:origin: org.grails/grails-hibernate
/**
* Creates a Criterion that contrains a collection property to be not equal to the given size
*
* @param propertyName The property name
* @param size The size to constrain by
*
* @return A Criterion instance
*/
public org.grails.datastore.mapping.query.api.Criteria sizeNe(String propertyName, int size) {
if (!validateSimpleExpression()) {
throwRuntimeException(new IllegalArgumentException("Call to [sizeNe] with propertyName [" +
propertyName + "] and size [" + size + "] not allowed here."));
}
propertyName = calculatePropertyName(propertyName);
addToCriteria(Restrictions.sizeNe(propertyName, size));
return this;
}
代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core
/**
* Creates a Criterion that contrains a collection property to be not equal to the given size
*
* @param propertyName The property name
* @param size The size to constrain by
*
* @return A Criterion instance
*/
public org.grails.datastore.mapping.query.api.Criteria sizeNe(String propertyName, int size) {
if (!validateSimpleExpression()) {
throwRuntimeException(new IllegalArgumentException("Call to [sizeNe] with propertyName [" +
propertyName + "] and size [" + size + "] not allowed here."));
}
propertyName = calculatePropertyName(propertyName);
addToCriteria(Restrictions.sizeNe(propertyName, size));
return this;
}
内容来源于网络,如有侵权,请联系作者删除!