GigaSpaces XAP 9.7.2 API

com.gigaspaces.query
Class IdsQuery<T>

java.lang.Object
  extended by com.gigaspaces.query.IdsQuery<T>
All Implemented Interfaces:
ISpaceQuery<T>

public class IdsQuery<T>
extends Object
implements ISpaceQuery<T>

Class to encapsulate information of a query based on multiple Space IDs. An IDs query is composed of a type (provided either as a java class or as a string which contains the type name) and a collection of ID values, and optionally routing value(s) an a query result type indicator.

Since:
8.0
Author:
Niv Ingberg
See Also:
QueryResultType, IdQuery

Constructor Summary
IdsQuery(Class<T> type, Object[] ids)
          Creates an IdsQuery using the specified type and IDs.
IdsQuery(Class<T> type, Object[] ids, Object routing)
          Creates an IdsQuery using the specified type, IDs and routing.
IdsQuery(Class<T> type, Object[] ids, Object[] routings)
          Creates an IdsQuery using the specified type, IDs and routing per id.
IdsQuery(Class<T> type, Object[] ids, Object[] routings, QueryResultType queryResultType)
          Creates an IdsQuery using the specified type, IDs, routing per id and query result type.
IdsQuery(Class<T> type, Object[] ids, Object routing, QueryResultType queryResultType)
          Creates an IdsQuery using the specified type, IDs, routing and query result type.
IdsQuery(Class<T> type, Object[] ids, QueryResultType queryResultType)
          Creates an IdsQuery using the specified type, IDs and query result type.
IdsQuery(String typeName, Object[] ids)
          Creates an IdsQuery using the specified type and IDs.
IdsQuery(String typeName, Object[] ids, Object routing)
          Creates an IdsQuery using the specified type, IDs and routing.
IdsQuery(String typeName, Object[] ids, Object[] routings)
          Creates an IdsQuery using the specified type, IDs and routing per id.
IdsQuery(String typeName, Object[] ids, Object[] routings, QueryResultType queryResultType)
          Creates an IdsQuery using the specified type, IDs, routing per id and query result type.
IdsQuery(String typeName, Object[] ids, Object routing, QueryResultType queryResultType)
          Creates an IdsQuery using the specified type, IDs, routing and query result type.
IdsQuery(String typeName, Object[] ids, QueryResultType queryResultType)
          Creates an IdsQuery using the specified type, IDs and query result type.
 
Method Summary
 Object[] getIds()
          Returns the IDs to match.
 String[] getProjections()
          Returns the projections set on this query, null means no projection is used and all the properties should be returned.
 QueryResultType getQueryResultType()
          Returns the type of result.
 Object getRouting()
          Returns the routing value used to determine the partition to query.
 Object[] getRoutings()
          Returns the routing values used to determine the partition to query.
 String getTypeName()
          Returns the name of type to query.
 IdsQuery<T> setProjections(String... properties)
          Sets projection properties which specifies that a result for an operation using this query should contain data for the specified projection properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdsQuery

public IdsQuery(Class<T> type,
                Object[] ids)
Creates an IdsQuery using the specified type and IDs.

Parameters:
type - Type to query.
ids - IDs to match.

IdsQuery

public IdsQuery(Class<T> type,
                Object[] ids,
                QueryResultType queryResultType)
Creates an IdsQuery using the specified type, IDs and query result type.

Parameters:
type - Type to query.
ids - IDs to match.
queryResultType - Type of result.

IdsQuery

public IdsQuery(Class<T> type,
                Object[] ids,
                Object routing)
Creates an IdsQuery using the specified type, IDs and routing.

Parameters:
type - Type to query.
ids - IDs to match.
routing - Routing value to determine which partition to query.

IdsQuery

public IdsQuery(Class<T> type,
                Object[] ids,
                Object routing,
                QueryResultType queryResultType)
Creates an IdsQuery using the specified type, IDs, routing and query result type.

Parameters:
type - Type to query.
ids - IDs to match.
routing - Routing value to determine which partition to query.
queryResultType - Type of result.

IdsQuery

public IdsQuery(Class<T> type,
                Object[] ids,
                Object[] routings)
Creates an IdsQuery using the specified type, IDs and routing per id.

Parameters:
type - Type to query.
ids - IDs to match.
routings - Routing values (per id) to determine which partition to query.

IdsQuery

public IdsQuery(Class<T> type,
                Object[] ids,
                Object[] routings,
                QueryResultType queryResultType)
Creates an IdsQuery using the specified type, IDs, routing per id and query result type.

Parameters:
type - Type to query.
ids - IDs to match.
routings - Routing values (per id) to determine which partition to query.
queryResultType - Type of result.

IdsQuery

public IdsQuery(String typeName,
                Object[] ids)
Creates an IdsQuery using the specified type and IDs.

Parameters:
typeName - Type to query.
ids - IDs to match.

IdsQuery

public IdsQuery(String typeName,
                Object[] ids,
                QueryResultType queryResultType)
Creates an IdsQuery using the specified type, IDs and query result type.

Parameters:
typeName - Type to query.
ids - IDs to match.
queryResultType - Type of result.

IdsQuery

public IdsQuery(String typeName,
                Object[] ids,
                Object routing)
Creates an IdsQuery using the specified type, IDs and routing.

Parameters:
typeName - Type to query.
ids - IDs to match.
routing - Routing value to determine which partition to query.

IdsQuery

public IdsQuery(String typeName,
                Object[] ids,
                Object routing,
                QueryResultType queryResultType)
Creates an IdsQuery using the specified type, IDs, routing and query result type.

Parameters:
typeName - Type to query.
ids - IDs to match.
routing - Routing value to determine which partition to query.
queryResultType - Type of result.

IdsQuery

public IdsQuery(String typeName,
                Object[] ids,
                Object[] routings)
Creates an IdsQuery using the specified type, IDs and routing per id.

Parameters:
typeName - Type to query.
ids - IDs to match.
routings - Routing values (per id) to determine which partition to query.

IdsQuery

public IdsQuery(String typeName,
                Object[] ids,
                Object[] routings,
                QueryResultType queryResultType)
Creates an IdsQuery using the specified type, IDs, routing per id and query result type.

Parameters:
typeName - Type to query.
ids - IDs to match.
routings - Routing values (per id) to determine which partition to query.
queryResultType - Type of result.
Method Detail

getTypeName

public String getTypeName()
Returns the name of type to query.


getIds

public Object[] getIds()
Returns the IDs to match.


getRouting

public Object getRouting()
Returns the routing value used to determine the partition to query.


getRoutings

public Object[] getRoutings()
Returns the routing values used to determine the partition to query.


getQueryResultType

public QueryResultType getQueryResultType()
Returns the type of result.


setProjections

public IdsQuery<T> setProjections(String... properties)
Sets projection properties which specifies that a result for an operation using this query should contain data for the specified projection properties. Other properties which were not specifies as a projection will not contain data. By default, if no projection was added, all the properties are returned with full data.


getProjections

public String[] getProjections()
Returns the projections set on this query, null means no projection is used and all the properties should be returned.


GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.