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 .