org.apache.ignite.internal.processors.query

## Interface GridQueryTypeDescriptor

All Known Implementing Classes:
  QueryTypeDescriptorImpl

    public interface GridQueryTypeDescriptor

Value descriptor which allows to extract fields from value object of given type.

### Method Summary

All Methods Instance Methods Abstract Methods
`String` `affinityKey()` Returns affinity key field name or `null` for default.
`Map<String,Class<?>>` `fields()` Gets mapping from field name to its type.
`Map<String,GridQueryIndexDescriptor>` `indexes()` Gets indexes for this type.
`Class<?>` `keyClass()` Gets key class.
`String` `keyFieldAlias()` Gets key field alias.
`String` `keyFieldName()` Gets key field name.
`String` `keyTypeName()` Gets key type name.
`String` `name()` Gets type name which uniquely identifies this type.
`GridQueryProperty` `property(String name)`
`String` `schemaName()` Gets schema name for type (database schema means here).
`void` `setDefaults(Object key, Object val)` Sets defaults value for given key and value.
`void` `setValue(String field, Object key, Object val, Object propVal)` Sets field value for given key and value.
`String` `tableName()` Gets table name for type.
`GridQueryIndexDescriptor` `textIndex()` Get text index for this type (if any).
`int` `typeId()`
`void` `validateKeyAndValue(Object key, Object val)` Performs validation of given key and value against configured constraints.
`<T> T` `value(String field, Object key, Object val)` Gets field value for given key and value.
`Class<?>` `valueClass()` Gets value class.
`String` `valueFieldAlias()` Gets value field alias.
`String` `valueFieldName()` Gets value field name.
`boolean` `valueTextIndex()` Returns `true` if string representation of value should be indexed as text.
`String` `valueTypeName()` Gets value type name.

### Method Detail

#### name

    String name()

Gets type name which uniquely identifies this type.

Returns:
  Type name which uniquely identifies this type.

#### schemaName

    String schemaName()

Gets schema name for type (database schema means here).

Returns:
  Schema name.

#### tableName

    String tableName()

Gets table name for type.

Returns:
  Table name.

#### fields

    Map<String,Class<?>> fields()

Gets mapping from field name to its type.

Returns:
  Fields that can be indexed, participate in queries and can be queried using method.

#### value

    <T> T value(String field,
                Object key,
                Object val)
         throws IgniteCheckedException

Gets field value for given key and value.

Parameters:
  `field` - Field name.
  `key` - Key.
  `val` - Value.
Returns:
  Value for given field.
Throws:
  `IgniteCheckedException` - If failed.

#### setValue

    void setValue(String field,
                  Object key,
                  Object val,
                  Object propVal)
           throws IgniteCheckedException

Sets field value for given key and value.

Parameters:
  `field` - Field name.
  `key` - Key.
  `val` - Value.
  `propVal` - Value for given field.
Throws:
  `IgniteCheckedException` - If failed.

#### property

    GridQueryProperty property(String name)

Parameters:
  `name` - Property name.
Returns:
  Property.

#### indexes

    Map<String,GridQueryIndexDescriptor> indexes()

Gets indexes for this type.

Returns:
  Indexes for this type.

#### textIndex

    GridQueryIndexDescriptor textIndex()

Get text index for this type (if any).

Returns:
  Text index or `null`.

#### valueClass

    Class<?> valueClass()

Gets value class.

Returns:
  Value class.

#### keyClass

    Class<?> keyClass()

Gets key class.

Returns:
  Key class.

#### keyTypeName

    String keyTypeName()

Gets key type name.

Returns:
  Key type name.

#### valueTypeName

    String valueTypeName()

Gets value type name.

Returns:
  Value type name.

#### valueTextIndex

    boolean valueTextIndex()

Returns `true` if string representation of value should be indexed as text.

Returns:
  If string representation of value should be full-text indexed.

#### affinityKey

    String affinityKey()

Returns affinity key field name or `null` for default.

Returns:
  Affinity key.

#### typeId

    int typeId()

Returns:
  BinaryObject's type ID if indexed value is BinaryObject, otherwise value class' hash code.

#### keyFieldName

    String keyFieldName()

Gets key field name.

Returns:
  Key field name.

#### valueFieldName

    String valueFieldName()

Gets value field name.

Returns:
  value field name.

#### keyFieldAlias

    @Nullable
    String keyFieldAlias()

Gets key field alias.

Returns:
  Key field alias.

#### valueFieldAlias

    @Nullable
    String valueFieldAlias()

Gets value field alias.

Returns:
  value field alias.

#### validateKeyAndValue

    void validateKeyAndValue(Object key,
                             Object val)
                      throws IgniteCheckedException

Performs validation of given key and value against configured constraints. Throws runtime exception if validation fails.

Parameters:
  `key` - Key.
  `val` - Value.
Throws:
  `IgniteCheckedException,` - If failure happens.
  `IgniteCheckedException`

#### setDefaults

    void setDefaults(Object key,
                     Object val)
              throws IgniteCheckedException

Sets defaults value for given key and value.

Parameters:
  `key` - Key.
  `val` - Value.
Throws:
  `IgniteCheckedException` - If failed.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018