public static boolean exampleHasAtLeastOneCriteriaCheck(Object parameter) {
        if (parameter != null) {
            try {
                if (parameter instanceof Example) {
                    List<Example.Criteria> criteriaList = ((Example) parameter).getOredCriteria();
                    if (criteriaList != null && criteriaList.size() > 0) {
                        return true;
                    }
                } else {
                    Method getter = parameter.getClass().getDeclaredMethod("getOredCriteria");
                    Object list = getter.invoke(parameter);
                    if(list != null && list instanceof List && ((List) list).size() > 0){
                        return true;
                    }
                }
            } catch (Exception e) {
                throw new MapperException(SAFE_DELETE_ERROR, e);
            }
        }
        throw new MapperException(SAFE_DELETE_EXCEPTION);
    }
public static boolean exampleHasAtLeastOneCriteriaCheck ( Object parameter ) { if ( parameter != null ) { try { if ( parameter instanceof Example ) { List < Example . Criteria > criteriaList = ( ( Example ) parameter ) . getOredCriteria ( ) ; if ( criteriaList != null && criteriaList . size ( ) > 0 ) { return true ; } } else { Method getter = parameter . getClass ( ) . getDeclaredMethod ( "getOredCriteria" ) ; Object list = getter . invoke ( parameter ) ; if ( list != null && list instanceof List && ( ( List ) list ) . size ( ) > 0 ) { return true ; } } } catch ( Exception e ) { throw new MapperException ( SAFE_DELETE_ERROR , e ) ; } } throw new MapperException ( SAFE_DELETE_EXCEPTION ) ; }
检查 paremeter 对象中指定的 fields 是否全是 null，如果是则抛出异常

@param parameter
@return