private void processPropertyFilter ( final StringBuilder whereBuilder , final List < Object > paramList , final PropertyFilter propertyFilter ) throws RepositoryException { String filterOperator ; switch ( propertyFilter . getOperator ( ) ) { case EQUAL : filterOperator = "=" ; break ; case GREATER_THAN : filterOperator = ">" ; break ; case GREATER_THAN_OR_EQUAL : filterOperator = ">=" ; break ; case LESS_THAN : filterOperator = "<" ; break ; case LESS_THAN_OR_EQUAL : filterOperator = "<=" ; break ; case NOT_EQUAL : filterOperator = "!=" ; break ; case IN : filterOperator = "IN" ; break ; case LIKE : filterOperator = "LIKE" ; break ; case NOT_LIKE : filterOperator = "NOT LIKE" ; break ; default : throw new RepositoryException ( "Unsupported filter operator [" + propertyFilter . getOperator ( ) + "]" ) ; } if ( FilterOperator . IN != propertyFilter . getOperator ( ) ) { whereBuilder . append ( propertyFilter . getKey ( ) ) . append ( " " ) . append ( filterOperator ) . append ( " ?" ) ; paramList . add ( propertyFilter . getValue ( ) ) ; } else { final Collection < Object > objects = ( Collection < Object > ) propertyFilter . getValue ( ) ; boolean isSubFist = true ; if ( objects != null && ! objects . isEmpty ( ) ) { whereBuilder . append ( propertyFilter . getKey ( ) ) . append ( " IN " ) ; final Iterator < Object > obs = objects . iterator ( ) ; while ( obs . hasNext ( ) ) { if ( isSubFist ) { whereBuilder . append ( "(" ) ; isSubFist = false ; } else { whereBuilder . append ( "," ) ; } whereBuilder . append ( "?" ) ; paramList . add ( obs . next ( ) ) ; if ( ! obs . hasNext ( ) ) { whereBuilder . append ( ") " ) ; } } } else { // in () => 1!=1 whereBuilder . append ( "1 != 1" ) ; } } }
Processes property filter .