protected void addSizeGreaterThanCondition(final String propertyName, final Integer size) {
        final Expression<Integer> propertySizeExpression = getCriteriaBuilder().size(getRootPath().get(propertyName).as(Set.class));
        fieldConditions.add(getCriteriaBuilder().gt(propertySizeExpression, size));
    }
protected void addSizeGreaterThanCondition ( final String propertyName , final Integer size ) { final Expression < Integer > propertySizeExpression = getCriteriaBuilder ( ) . size ( getRootPath ( ) . get ( propertyName ) . as ( Set . class ) ) ; fieldConditions . add ( getCriteriaBuilder ( ) . gt ( propertySizeExpression , size ) ) ; }
Add a Field Search Condition that will check if the size of a collection in an entity is greater than the specified size.

@param propertyName The name of the collection as defined in the Entity mapping class.
@param size         The size that the collection should be greater than.