GemStone::GemFire::Cache::Generic::Query< TResult > Class Template Reference

Inherits GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Query >.


Detailed Description

template<class TResult>
class GemStone::GemFire::Cache::Generic::Query< TResult >

Class to encapsulate a query.

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.

Public Member Functions

void Compile ()
ISelectResults
< TResult >^ 
Execute (array< Object^ >^paramList)
ISelectResults
< TResult >^ 
Execute (array< Object^ >^paramList, uint32_t timeout)
ISelectResults
< TResult >^ 
Execute (uint32_t timeout)
ISelectResults
< TResult >^ 
Execute ()

Protected Member Functions

void _SetNativePtr (gemfire::Query *nativeptr)
void AssignPtr (gemfire::Query *nativeptr)
void InternalCleanup ()
void SetPtr (gemfire::Query *nativeptr)

Properties

bool IsCompiled [get]
String^  QueryString [get]


Member Function Documentation

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Query >::_SetNativePtr ( gemfire::Query *  nativeptr  )  [inline, protected, inherited]

Set the native pointer to the new object without doing a preserveSB(). DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING.

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Query >::AssignPtr ( gemfire::Query *  nativeptr  )  [inline, protected, inherited]

Used to assign the native pointer to a new object.

Note the order of preserveSB() and releaseSB(). This handles the corner case when m_nativeptr is same as nativeptr.

template<class TResult>
void GemStone::GemFire::Cache::Generic::Query< TResult >::Compile (  ) 

Compile the given query -- NOT IMPLEMENTED.

template<class TResult>
ISelectResults<TResult> ^ GemStone::GemFire::Cache::Generic::Query< TResult >::Execute ( array< Object^ >^  paramList  ) 

Executes the OQL Parameterized Query on the cache server with the specified paramList and returns the results. The default timeout for the query is 15 secs.

Parameters:
paramList The Parameter List for the specified Query.
Exceptions:
IllegalArgumentException if timeout parameter is greater than 2^31/1000.
QueryException if some query error occurred at the server.
IllegalStateException if some other error occurred.
NotConnectedException if no java cache server is available For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException.
Returns:
An ISelectResults object which can either be a ResultSet or a StructSet.

template<class TResult>
ISelectResults<TResult> ^ GemStone::GemFire::Cache::Generic::Query< TResult >::Execute ( array< Object^ >^  paramList,
uint32_t  timeout 
)

Executes the OQL Parameterized Query on the cache server with the specified paramList & timeout parameters and returns the results.

Parameters:
paramList The Parameter List for the specified Query.
timeout The time (in seconds) to wait for query response. This should be less than or equal to 2^31/1000 i.e. 2147483.
Exceptions:
IllegalArgumentException if timeout parameter is greater than 2^31/1000.
QueryException if some query error occurred at the server.
IllegalStateException if some other error occurred.
NotConnectedException if no java cache server is available For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException.
Returns:
An ISelectResults object which can either be a ResultSet or a StructSet.

template<class TResult>
ISelectResults<TResult> ^ GemStone::GemFire::Cache::Generic::Query< TResult >::Execute ( uint32_t  timeout  ) 

Executes the OQL Query on the cache server with the specified timeout and returns the results.

Parameters:
timeout The time (in seconds) to wait for query response. This should be less than or equal to 2^31/1000 i.e. 2147483.
Exceptions:
IllegalArgumentException if timeout parameter is greater than 2^31/1000.
QueryException if some query error occurred at the server.
IllegalStateException if some other error occurred.
NotConnectedException if no java cache server is available For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException.
Returns:
An ISelectResults object which can either be a ResultSet or a StructSet.

template<class TResult>
ISelectResults<TResult> ^ GemStone::GemFire::Cache::Generic::Query< TResult >::Execute (  ) 

Executes the OQL Query on the cache server and returns the results. The default timeout for the query is 15 secs.

Exceptions:
QueryException if some query error occurred at the server.
IllegalStateException if some other error occurred.
NotConnectedException if no java cache server is available. For pools configured with locators, if no locators are available, innerException of NotConnectedException is set to NoAvailableLocatorsException.
Returns:
An ISelectResults object which can either be a ResultSet or a StructSet.

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Query >::InternalCleanup (  )  [inline, protected, inherited]

Internal cleanup function invoked by dispose/finalizer.

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Query >::SetPtr ( gemfire::Query *  nativeptr  )  [inline, protected, inherited]

Used to set the native pointer to a new object. This should only be used when you know that the underlying object is NULL.


Property Documentation

template<class TResult>
bool GemStone::GemFire::Cache::Generic::Query< TResult >::IsCompiled [get]

Check if the query is compiled -- NOT IMPLEMENTED.

template<class TResult>
String^ GemStone::GemFire::Cache::Generic::Query< TResult >::QueryString [get]

Get the string for this query.


GemFire C++ Cache .NET API Documentation