anchor.diff:  ---
  -title:  Remote Queries
  +title: Remote Queries
   ---
   
   <!--
  
positive.code: To use a query string in a client, specify the string as a parameter in a `QueryService::newQuery`
  method, then execute the query using `Query::execute`, passing in the required parameters.
  
  If your query requires any `IMPORT` statements, you must include these before the `SELECT` statement
  in the query string that is passed to the query engine. It should be a fully qualified package name
  relative to the cache server. The Java class definition must exist and have the same signature as
  the client C++ class.
  
  ### <a id="TypeConversions"></a>Type Conversions
  
  Java rules within a query string require the query processor to perform implicit conversions and
  promotions under certain cases in order to evaluate expressions that contain different types.
  
  The query processor performs binary numeric promotion, method invocation conversion, and temporal type conversion.
  
  ## <a id="RemoteQueryAPI"></a>Remote Query API
  
  This section gives a general overview of the interfaces and classes that are provided by the Query
  package API, and the shortcut methods provided in the Region interface.
  
  ### <a id="CreatingAndManagingQueries"></a>Creating and Managing Queries
  
  You create queries on the cache server by obtaining a `QueryService` method and manage them through
  the resulting `Query` object. The `Region` interface has several shortcut query methods.
  
  ### <a id="Query"></a>Query
  
  A `Query` is obtained from a `QueryService` method, which is obtained from the cache. The `Query` interface provides methods for managing the compilation and execution of queries, and for retrieving an existing query string.
  
  You must obtain a `Query` object for each new query.
  
  
  
negative.code: limitations under the License.
  -->
  
  Use the client query API to query your cached data stored on a cache server. 
  
  ## <a id="Remote Query Basics"></a>Remote Query Basics
  
  Queries are evaluated and executed on the cache server, and the results are returned to the client.
  You can optimize your queries by defining indexes on the cache server.
  
  Querying and indexing operate only on remote cache server contents.
  
  ### <a id="QueryLanguage"></a>Query language: OQL
  <%=vars.product_name%> provides a SQL-like querying language called OQL that allows you to access data stored in <%=vars.product_name%> regions.
  
  <%=vars.product_name%> uses a query syntax based on OQL (Object Query Language) to query region
  data. OQL is very similar to SQL, but OQL allows you to query complex objects, object attributes,
  and methods.
  
  Query language features and grammar are described in the <%=vars.product_name%> manual at
  [Querying](geodeman/developing/querying_basics/chapter_overview.html). This section describes areas
  that are unique to the native client.
  
  ## <a id="RemoteQueryAPI"></a>Remote Query API
  
  This section gives a general overview of the interfaces and classes that are provided by the Query
  package API, and the shortcut methods provided in the Region interface.
  
  ### <a id="CreatingAndManagingQueries"></a>Creating and Managing Queries
  
  You create queries on the cache server by obtaining a `QueryService` method and manage them through
  the resulting `Query` object. The `Region` interface has several shortcut query methods.
  
  ### <a id="Query"></a>Query
  
  A `Query` is obtained from a `QueryService` method, which is obtained from the cache. The `Query` interface provides methods for managing the compilation and execution of queries, and for retrieving an existing query string.
  
  You must obtain a `Query` object for each new query.
  
  ### <a id="ExecutingAQuery"></a>Executing a Query from the Client
  
  -  Get a pointer to the `QueryService` method. If you are using the pool API, you should obtain the `QueryService` from the pool.
  -  Create a `QueryPtr` to a query (C++) or create a query instance (.NET) that is compatible with the OQL specification.
  -  Use the `execute` method for the `Query` interface to submit the query string to the cache server. The server remotely evaluates the query string and returns the results to the client.
  -  You can iterate through the returned objects as part of the query process.
  
  ## <a id="AccessingCachedData"></a>Accessing Cached Data
  
  Accessing your cached data through the querying service is similar to accessing database contents
  through SQL queries. How you specify your regions and region contents is particular to the client.
  
  The query language supports drilling down into nested object structures.
  Nested data collections can be explicitly referenced in the FROM clause of a query.
  
  ### <a id="ModifyingCacheContents"></a>Modifying Cache Contents
  
  