org.apache.ignite.cache.query.annotations

## Annotation Type QuerySqlField

    @Documented
    @Retention(value=RUNTIME)
    @Target(value={METHOD,FIELD})
    public @interface QuerySqlField

Annotates fields for SQL queries. All fields that will be involved in SQL clauses must have this annotation. For more information about cache queries see `CacheQuery` documentation.

See Also:
  `CacheQuery`

### Optional Element Summary

Optional Elements
`boolean` `descending` Specifies whether index should be in descending order or not.
`String[]` `groups` Array of index groups this field belongs to.
`boolean` `index` Specifies whether cache should maintain an index for this field or not.
`String` `name` Property name.
`QuerySqlField.Group[]` `orderedGroups` Array of ordered index groups this field belongs to.

### Element Detail

#### index

    public abstract boolean index

Specifies whether cache should maintain an index for this field or not. Just like with databases, field indexing may require additional overhead during updates, but makes select operations faster.

When indexing SPI and indexed field is of type `com.vividsolutions.jts.geom.Geometry` (or any subclass of this class) then Ignite will consider this index as spatial providing performance boost for spatial queries.

Returns:
  `True` if index must be created for this field in database.

Default:
  false

#### descending

    public abstract boolean descending

Specifies whether index should be in descending order or not. This property only makes sense if `index()` property is set to `true`.

Returns:
  `True` if field index should be in descending order.

Default:
  false

#### groups

    public abstract String[] groups

Array of index groups this field belongs to. Groups are used for compound indexes, whenever index should be created on more than one field. All fields within the same group will belong to the same index.

Group indexes are needed because SQL engine can utilize only one index per table occurrence in a query. For example if we have two separate indexes on fields `a` and `b` of type `X` then query `select * from X where a = ? and b = ?` will use for filtering either index on field `a` or `b` but not both. For more effective query execution here it is preferable to have a single group index on both fields.

For more complex scenarios please refer to `QuerySqlField.Group` documentation.

Returns:
  Array of group names.

Default:
  {}

#### orderedGroups

    public abstract QuerySqlField.Group[] orderedGroups

Array of ordered index groups this field belongs to. For more information please refer to QuerySqlField.Group documentation.

Returns:
  Array of ordered group indexes.
See Also:
  `groups()`

Default:
  {}

#### name

    public abstract String name

Property name. If not provided then field name will be used.

Returns:
  Name of property.

Default:
  ""

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0.final
Release Date | : December 29 2015