Pivotal GemFire Native Client Cache Reference  9.0.6
gemfire::Query Class Referenceabstract

A Query is obtained from a QueryService which in turn is obtained from the Cache. More...

Inherits gemfire::SharedBase.

Public Member Functions

virtual void compile ()=0
 Compile the Query - client side query compilation is not supported. More...
 
virtual SelectResultsPtr execute (uint32_t timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)=0
 Executes the OQL Query on the cache server and returns the results. More...
 
virtual SelectResultsPtr execute (CacheableVectorPtr paramList, uint32_t timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)=0
 Executes the parameterized OQL Query on the cache server and returns the results. More...
 
virtual const char * getQueryString () const =0
 Get the query string provided when a new Query was created from a QueryService. More...
 
virtual bool isCompiled ()=0
 Check whether the Query is compiled - client side query compilation is not supported. More...
 
void preserveSB () const
 Atomically increment reference count. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. More...
 

Detailed Description

A Query is obtained from a QueryService which in turn is obtained from the Cache.

This can be executed to return SelectResults which can be either a ResultSet or a StructSet.

This class is intentionally not thread-safe. So multiple threads should not operate on the same Query object concurrently rather should have their own Query objects.

Member Function Documentation

virtual void gemfire::Query::compile ( )
pure virtual

Compile the Query - client side query compilation is not supported.

Exceptions
UnsupportedOperationExceptionbecause this is not currently supported.
virtual SelectResultsPtr gemfire::Query::execute ( uint32_t  timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT)
pure virtual

Executes the OQL Query on the cache server and returns the results.

Parameters
timeoutThe time (in seconds) to wait for query response, optional. This should be less than or equal to 2^31/1000 i.e. 2147483.
Exceptions
IllegalArgumentExceptionif timeout parameter is greater than 2^31/1000.
QueryExceptionif some query error occurred at the server.
IllegalStateExceptionif some error occurred.
NotConnectedExceptionif no java cache server is available. For pools configured with locators, if no locators are available, the cause of NotConnectedException is set to NoAvailableLocatorsException.
Returns
A smart pointer to the SelectResults which can either be a ResultSet or a StructSet.
virtual SelectResultsPtr gemfire::Query::execute ( CacheableVectorPtr  paramList,
uint32_t  timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT 
)
pure virtual

Executes the parameterized OQL Query on the cache server and returns the results.

Parameters
paramListThe query parameters list
timeoutThe time (in seconds) to wait for query response, optional. This should be less than or equal to 2^31/1000 i.e. 2147483.
Exceptions
IllegalArgumentExceptionif timeout parameter is greater than 2^31/1000.
QueryExceptionif some query error occurred at the server.
IllegalStateExceptionif some error occurred.
NotConnectedExceptionif no java cache server is available. For pools configured with locators, if no locators are available, the cause of NotConnectedException is set to NoAvailableLocatorsException. returns A smart pointer to the SelectResults which can either be a ResultSet or a StructSet.
virtual const char* gemfire::Query::getQueryString ( ) const
pure virtual

Get the query string provided when a new Query was created from a QueryService.

Returns
The query string.
virtual bool gemfire::Query::isCompiled ( )
pure virtual

Check whether the Query is compiled - client side query compilation is not supported.

Exceptions
UnsupportedOperationExceptionbecause this is not currently supported.
void gemfire::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

int32_t gemfire::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
void gemfire::SharedBase::releaseSB ( ) const
inherited

Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.


GemFire C++ Cache API Documentation