本文整理了Java中org.hibernate.criterion.Restrictions.sizeGe
方法的一些代码示例,展示了Restrictions.sizeGe
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Restrictions.sizeGe
方法的具体详情如下:
包路径:org.hibernate.criterion.Restrictions
类名称:Restrictions
方法名:sizeGe
[英]Constrain a collection valued property by size
[中]按大小约束集合值属性
代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core
@Override
public Criterion toHibernateCriterion(AbstractHibernateQuery hibernateQuery, Query.SizeGreaterThanEquals criterion, String alias) {
String propertyName = getPropertyName(criterion, alias);
Object value = criterion.getValue();
int size = value instanceof Number ? ((Number)value).intValue() : Integer.parseInt(value.toString());
return Restrictions.sizeGe(propertyName, size);
}
});
代码示例来源:origin: org.grails/grails-hibernate
@Override
public org.hibernate.criterion.Criterion toHibernateCriterion(HibernateQuery hibernateQuery, Query.Criterion criterion, String alias) {
Query.SizeGreaterThanEquals eq = (Query.SizeGreaterThanEquals) criterion;
return Restrictions.sizeGe(calculatePropertyName(eq.getProperty(), alias), (Integer) eq.getValue());
}
});
代码示例来源:origin: org.grails/grails-hibernate
/**
* Creates a Criterion that contrains a collection property to be greater than or 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 sizeGe(String propertyName, int size) {
if (!validateSimpleExpression()) {
throwRuntimeException(new IllegalArgumentException("Call to [sizeGe] with propertyName [" +
propertyName + "] and size [" + size + "] not allowed here."));
}
propertyName = calculatePropertyName(propertyName);
addToCriteria(Restrictions.sizeGe(propertyName, size));
return this;
}
代码示例来源:origin: denimgroup/threadfix
private void addMinimumMergedFindings() {
if (parameters.getNumberMerged() != null && parameters.getNumberMerged() > 0) {
LOG.debug("Adding number merged = " + parameters.getNumberMerged());
criteria.add(Restrictions.sizeGe("findings", parameters.getNumberMerged()));
}
}
代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core
/**
* Creates a Criterion that contrains a collection property to be greater than or 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 sizeGe(String propertyName, int size) {
if (!validateSimpleExpression()) {
throwRuntimeException(new IllegalArgumentException("Call to [sizeGe] with propertyName [" +
propertyName + "] and size [" + size + "] not allowed here."));
}
propertyName = calculatePropertyName(propertyName);
addToCriteria(Restrictions.sizeGe(propertyName, size));
return this;
}
代码示例来源:origin: dhis2/dhis2-core
@Override
public Criterion getHibernateCriterion( QueryPath queryPath )
{
Property property = queryPath.getProperty();
if ( property.isCollection() )
{
Integer value = QueryUtils.parseValue( Integer.class, args.get( 0 ) );
if ( value == null )
{
throw new QueryException( "Left-side is collection, and right-side is not a valid integer, so can't compare by size." );
}
return Restrictions.sizeGe( queryPath.getPath(), value );
}
return Restrictions.ge( queryPath.getPath(), args.get( 0 ) );
}
内容来源于网络,如有侵权,请联系作者删除!