gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/io/Querier.java
@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;
		}

	}
@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;
		}

	}
@ 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
@param <ReturnType> the collection return type
@param queryObj the query object
@param rfc the region function context
@param params the bind variables
@return collection of results
@throws FunctionDomainException function error occurs
@throws TypeMismatchException type error occurs
@throws NameResolutionException name resolution exception occurs
@throws QueryInvocationTargetException when query invocation target exception occurs
Select results for OQL