org.apache.ignite.cache.query

## Class Query<T extends Query>

- java.lang.Object
- - org.apache.ignite.cache.query.Query<T>

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  ContinuousQuery, ScanQuery, SpiQuery, SqlFieldsQuery, SqlQuery, TextQuery

    public abstract class Query<T extends Query>
    extends Object
    implements Serializable

Base class for all Ignite cache queries. Use `SqlQuery` and `TextQuery` for SQL and text queries accordingly.

Also contains convenience shortcuts for query object construction: `sql(Class, String)`, `sql(String)`, `text(Class, String)`, `scan(IgniteBiPredicate)` and `spi()`.

See Also:
  `IgniteCache.query(Query)`, `IgniteCache.localQuery(Query)`, `IgniteCache.queryFields(SqlFieldsQuery)`, `IgniteCache.localQueryFields(SqlFieldsQuery)`, Serialized Form

### Method Summary

Methods
`static <K,V> ContinuousQuery<K,V>` `continuous()` Factory method for continuous queries.
`int` `getPageSize()` Gets optional page size, if `0`, then `CacheQueryConfiguration#getPageSize()` is used.
`static <K,V> ScanQuery<K,V>` `scan(IgniteBiPredicate<K,V> filter)` Factory method for SPI queries.
`T` `setPageSize(int pageSize)` Sets optional page size, if `0`, then `CacheQueryConfiguration#getPageSize()` is used.
`static SpiQuery` `spi()` Factory method for SPI queries.
`static SqlQuery` `sql(Class<?> type, String sql)` Factory method for SQL queries.
`static SqlFieldsQuery` `sql(String sql)` Factory method for SQL fields queries.
`static TextQuery` `text(Class<?> type, String txt)` Factory method for Lucene fulltext queries.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Method Detail

#### sql

    public static SqlFieldsQuery sql(String sql)

Factory method for SQL fields queries.

Parameters:
  `sql` - SQL Query string.
Returns:
  SQL Fields query instance.

#### sql

    public static SqlQuery sql(Class<?> type,
               String sql)

Factory method for SQL queries.

Parameters:
  `type` - Type to be queried.
  `sql` - SQL Query string.
Returns:
  SQL Query instance.

#### text

    public static TextQuery text(Class<?> type,
                 String txt)

Factory method for Lucene fulltext queries.

Parameters:
  `type` - Type to be queried.
  `txt` - Search string.
Returns:
  Fulltext query.

#### scan

    public static <K,V> ScanQuery<K,V> scan(IgniteBiPredicate<K,V> filter)

Factory method for SPI queries.

Parameters:
  `filter` - Filter.
Returns:
  SPI Query.

#### spi

    public static SpiQuery spi()

Factory method for SPI queries.

Returns:
  SPI Query.
See Also:
  `IndexingSpi`

#### continuous

    public static <K,V> ContinuousQuery<K,V> continuous()

Factory method for continuous queries.

Returns:
  Continuous query.

#### getPageSize

    public int getPageSize()

Gets optional page size, if `0`, then `CacheQueryConfiguration#getPageSize()` is used.

Returns:
  Optional page size.

#### setPageSize

    public T setPageSize(int pageSize)

Sets optional page size, if `0`, then `CacheQueryConfiguration#getPageSize()` is used.

Parameters:
  `pageSize` - Optional page size.
Returns:
  `this` For chaining.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015