@ SuppressWarnings ( "unchecked" ) public static < ReturnType > Collection < ReturnType > query ( Query queryObj , RegionFunctionContext rfc , Object ... params ) throws FunctionDomainException , TypeMismatchException , NameResolutionException , QueryInvocationTargetException { SelectResults < ReturnType > selectResults ; // Execute Query locally. Returns results set. if ( rfc == null || JvmRegionFunctionContext . class . isAssignableFrom ( rfc . getClass ( ) ) ) { if ( params == null || params . length == 0 ) { selectResults = ( SelectResults < ReturnType > ) queryObj . execute ( ) ; } else { selectResults = ( SelectResults < ReturnType > ) queryObj . execute ( params ) ; } if ( selectResults == null || selectResults . isEmpty ( ) ) return null ; ArrayList < ReturnType > results = new ArrayList < ReturnType > ( selectResults . size ( ) ) ; results . addAll ( selectResults . asList ( ) ) ; return results ; } else { if ( params == null || params . length == 0 ) { selectResults = ( SelectResults < ReturnType > ) queryObj . execute ( rfc ) ; } else { selectResults = ( SelectResults < ReturnType > ) queryObj . execute ( rfc , params ) ; } if ( selectResults == null || selectResults . isEmpty ( ) ) return null ; return selectResults ; } }
Select results for OQL