public org.grails.datastore.mapping.query.api.Criteria sqlRestriction(String sqlRestriction, List<?> values) {
        if (!validateSimpleExpression()) {
            throwRuntimeException(new IllegalArgumentException("Call to [sqlRestriction] with value [" +
                    sqlRestriction + "] not allowed here."));
        }
        final int numberOfParameters = values.size();

        final Type[] typesArray = new Type[numberOfParameters];
        final Object[] valuesArray = new Object[numberOfParameters];

        if (numberOfParameters > 0) {
            final TypeHelper typeHelper = sessionFactory.getTypeHelper();
            for (int i = 0; i < typesArray.length; i++) {
                final Object value = values.get(i);
                typesArray[i] =  typeHelper.basic(value.getClass());
                valuesArray[i] = value;
            }
        }
        addToCriteria(Restrictions.sqlRestriction(sqlRestriction, valuesArray, typesArray));
        return this;
    }
public org . grails . datastore . mapping . query . api . Criteria sqlRestriction ( String sqlRestriction , List < ? > values ) { if ( ! validateSimpleExpression ( ) ) { throwRuntimeException ( new IllegalArgumentException ( "Call to [sqlRestriction] with value [" + sqlRestriction + "] not allowed here." ) ) ; } final int numberOfParameters = values . size ( ) ; final Type [ ] typesArray = new Type [ numberOfParameters ] ; final Object [ ] valuesArray = new Object [ numberOfParameters ] ; if ( numberOfParameters > 0 ) { final TypeHelper typeHelper = sessionFactory . getTypeHelper ( ) ; for ( int i = 0 ; i < typesArray . length ; i ++ ) { final Object value = values . get ( i ) ; typesArray [ i ] = typeHelper . basic ( value . getClass ( ) ) ; valuesArray [ i ] = value ; } } addToCriteria ( Restrictions . sqlRestriction ( sqlRestriction , valuesArray , typesArray ) ) ; return this ; }
Applies a sql restriction to the results to allow something like:

@param sqlRestriction the sql restriction
@param values jdbc parameters
@return a Criteria instance