Interface GridQueryTypeDescriptor
-
- All Known Implementing Classes:
QueryTypeDescriptorImpl
public interface GridQueryTypeDescriptorValue descriptor which allows to extract fields from value object of given type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intaffinityFieldInlineSize()Gets affinity fields index INLINE_SIZE.voidaffinityFieldInlineSize(int affFieldInlineSize)Sets affinity fields index INLINE_SIZE.StringaffinityKey()Returns affinity key field name ornullfor default.StringcacheName()Gets cache name of this type.booleancustomAffinityKeyMapper()Map<String,Class<?>>fields()Gets mapping from field name to its type.booleanfillAbsentPKsWithDefaults()booleanimplicitPk()Gets whether a primary key should be autogenerated.voidimplicitPk(boolean implicitPk)Sets whether a primary key should be autogenerated.Map<String,GridQueryIndexDescriptor>indexes()Gets indexes for this type.Class<?>keyClass()Gets key class.@Nullable StringkeyFieldAlias()Gets key field alias.StringkeyFieldName()Gets key field name.StringkeyTypeName()Gets key type name.booleanmatchType(CacheObject val)Stringname()Gets type name which uniquely identifies this type.Set<String>primaryKeyFields()Gets primary key fields if defined, or empty collection otherwise.voidprimaryKeyFields(Set<String> keys)Sets primary key fields.intprimaryKeyInlineSize()Gets primary key index INLINE_SIZE.voidprimaryKeyInlineSize(int pkInlineSize)Sets primary key index INLINE_SIZE.Map<String,GridQueryProperty>properties()GridQueryPropertyproperty(String name)StringschemaName()Gets schema name for type (database schema means here).voidsetDefaults(Object key, Object val)Sets defaults value for given key and value.voidsetFillAbsentPKsWithDefaults(boolean fillAbsentPKsWithDefaults)Sets up fillAbsentPKsWithDefaults flag.voidsetValue(String field, Object key, Object val, Object propVal)Sets field value for given key and value.StringtableName()Gets table name for type.GridQueryIndexDescriptortextIndex()Get text index for this type (if any).inttypeId()voidvalidateKeyAndValue(Object key, Object val)Performs validation of given key and value against configured constraints.<T> Tvalue(String field, Object key, Object val)Gets field value for given key and value.Class<?>valueClass()Gets value class.@Nullable StringvalueFieldAlias()Gets value field alias.StringvalueFieldName()Gets value field name.booleanvalueTextIndex()Returnstrueif string representation of value should be indexed as text.StringvalueTypeName()Gets value type name.
-
-
-
Method Detail
-
cacheName
String cacheName()
Gets cache name of this type.- Returns:
- Cache name.
-
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.
-
properties
Map<String,GridQueryProperty> properties()
- Returns:
- All properties.
-
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()
Returnstrueif 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 ornullfor default.- Returns:
- Affinity key.
-
customAffinityKeyMapper
boolean customAffinityKeyMapper()
- Returns:
- Whether custom affinity key mapper exists.
-
typeId
int typeId()
- Returns:
- BinaryObject's type ID if indexed value is BinaryObject, otherwise value class' hash code.
-
matchType
boolean matchType(CacheObject val)
- Parameters:
val- Value cache object.- Returns:
trueIf the type of the given value cache object matches this descriptor.
-
keyFieldName
String keyFieldName()
Gets key field name.- Returns:
- Key field name.
-
valueFieldName
String valueFieldName()
Gets value field name.- Returns:
- value field name.
-
keyFieldAlias
@Nullable @Nullable String keyFieldAlias()
Gets key field alias.- Returns:
- Key field alias.
-
valueFieldAlias
@Nullable @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
-
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.
-
primaryKeyFields
Set<String> primaryKeyFields()
Gets primary key fields if defined, or empty collection otherwise.
-
primaryKeyFields
void primaryKeyFields(Set<String> keys)
Sets primary key fields.- Parameters:
keys- Primary keys.
-
implicitPk
boolean implicitPk()
Gets whether a primary key should be autogenerated.
-
implicitPk
void implicitPk(boolean implicitPk)
Sets whether a primary key should be autogenerated.- Parameters:
implicitPk- Whether a PK should be autogenerated.
-
fillAbsentPKsWithDefaults
boolean fillAbsentPKsWithDefaults()
- Returns:
trueif absent PK parts should be filled with defaults,falseotherwise.
-
setFillAbsentPKsWithDefaults
void setFillAbsentPKsWithDefaults(boolean fillAbsentPKsWithDefaults)
Sets up fillAbsentPKsWithDefaults flag.- Parameters:
fillAbsentPKsWithDefaults- Flag.
-
primaryKeyInlineSize
int primaryKeyInlineSize()
Gets primary key index INLINE_SIZE.
-
primaryKeyInlineSize
void primaryKeyInlineSize(int pkInlineSize)
Sets primary key index INLINE_SIZE.
-
affinityFieldInlineSize
int affinityFieldInlineSize()
Gets affinity fields index INLINE_SIZE.
-
affinityFieldInlineSize
void affinityFieldInlineSize(int affFieldInlineSize)
Sets affinity fields index INLINE_SIZE.
-
-