public class QueryTypeDescriptorImpl extends Object implements GridQueryTypeDescriptor
| Constructor and Description |
|---|
QueryTypeDescriptorImpl(String cacheName,
CacheObjectContext coCtx)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFieldToTextIndex(String field)
Adds field to text index.
|
void |
addIndex(QueryIndexDescriptorImpl idx)
Add index.
|
void |
addProperty(GridQueryProperty prop,
boolean failOnDuplicate)
Adds property to the type descriptor.
|
void |
addProperty(GridQueryProperty prop,
boolean failOnDuplicate,
boolean isField)
Adds property to the type descriptor.
|
String |
affinityKey()
Returns affinity key field name or
null for default. |
void |
affinityKey(String affKey) |
Map<String,String> |
aliases() |
void |
aliases(Map<String,String> aliases) |
String |
cacheName() |
boolean |
customAffinityKeyMapper() |
void |
customAffinityKeyMapper(boolean customAffKeyMapper) |
void |
dropIndex(String idxName)
Drop index.
|
LinkedHashMap<String,Class<?>> |
fields()
Gets mapping from field name to its type.
|
boolean |
hasField(String field)
Chedk if particular field exists.
|
@Nullable QueryIndexDescriptorImpl |
index(String name)
Get index by name.
|
Map<String,GridQueryIndexDescriptor> |
indexes()
Gets indexes for this type.
|
Collection<QueryIndexDescriptorImpl> |
indexes0() |
Class<?> |
keyClass()
Gets key class.
|
void |
keyClass(Class<?> keyCls)
Set key class.
|
@Nullable String |
keyFieldAlias()
Gets key field alias.
|
String |
keyFieldName()
Gets key field name.
|
String |
keyTypeName()
Gets key type name.
|
void |
keyTypeName(String keyTypeName)
Set key type name.
|
void |
markObsolete()
Mark index as obsolete.
|
boolean |
matchType(CacheObject val) |
String |
name()
Gets type name which uniquely identifies this type.
|
void |
name(String name)
Sets type name.
|
boolean |
obsolete() |
Set<String> |
primaryKeyFields()
Gets primary key fields if defined, or empty collection otherwise.
|
void |
primaryKeyFields(Set<String> keys)
Sets primary key fields.
|
Map<String,GridQueryProperty> |
properties() |
GridQueryProperty |
property(String name) |
void |
removeProperty(String name)
Removes a property with specified name.
|
String |
schemaName()
Gets schema name for type (database schema means here).
|
void |
schemaName(String schemaName) |
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.
|
void |
tableName(String tblName)
Sets table name for type.
|
GridQueryIndexDescriptor |
textIndex()
Get text index for this type (if any).
|
String |
toString() |
int |
typeId() |
void |
typeId(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.
|
void |
valueClass(Class<?> valCls)
Sets value class.
|
@Nullable 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. |
void |
valueTextIndex(boolean valTextIdx)
Sets if this value should be text indexed.
|
String |
valueTypeName()
Gets value type name.
|
void |
valueTypeName(String valTypeName)
Set value type name.
|
public QueryTypeDescriptorImpl(String cacheName, CacheObjectContext coCtx)
cacheName - Cache name.coCtx - Cache object context.public String cacheName()
public String name()
name in interface GridQueryTypeDescriptorpublic String schemaName()
schemaName in interface GridQueryTypeDescriptorpublic void name(String name)
name - Name.public String tableName()
tableName in interface GridQueryTypeDescriptorpublic void tableName(String tblName)
tblName - Table name.public LinkedHashMap<String,Class<?>> fields()
fields in interface GridQueryTypeDescriptorpublic GridQueryProperty property(String name)
property in interface GridQueryTypeDescriptorname - Property name.public Map<String,GridQueryProperty> properties()
public <T> T value(String field, Object key, Object val) throws IgniteCheckedException
value in interface GridQueryTypeDescriptorfield - Field name.key - Key.val - Value.IgniteCheckedException - If failed.public void setValue(String field, Object key, Object val, Object propVal) throws IgniteCheckedException
setValue in interface GridQueryTypeDescriptorfield - Field name.key - Key.val - Value.propVal - Value for given field.IgniteCheckedException - If failed.public Map<String,GridQueryIndexDescriptor> indexes()
indexes in interface GridQueryTypeDescriptorpublic int typeId()
typeId in interface GridQueryTypeDescriptorpublic boolean matchType(CacheObject val)
matchType in interface GridQueryTypeDescriptorval - Value cache object.true If the type of the given value cache object matches this descriptor.public void typeId(int typeId)
typeId - Type ID.@Nullable public @Nullable QueryIndexDescriptorImpl index(String name)
name - Name.public Collection<QueryIndexDescriptorImpl> indexes0()
public GridQueryIndexDescriptor textIndex()
textIndex in interface GridQueryTypeDescriptornull.public void addIndex(QueryIndexDescriptorImpl idx) throws IgniteCheckedException
idx - Index.IgniteCheckedException - If failed.public void dropIndex(String idxName)
idxName - Index name.public boolean hasField(String field)
field - Field.True if exists.public void addFieldToTextIndex(String field) throws IgniteCheckedException
field - Field name.IgniteCheckedException - If failed.public Class<?> valueClass()
valueClass in interface GridQueryTypeDescriptorpublic void valueClass(Class<?> valCls)
valCls - Value class.public Class<?> keyClass()
keyClass in interface GridQueryTypeDescriptorpublic void keyClass(Class<?> keyCls)
keyCls - Key class.public String keyTypeName()
keyTypeName in interface GridQueryTypeDescriptorpublic void keyTypeName(String keyTypeName)
keyTypeName - Key type name.public String valueTypeName()
valueTypeName in interface GridQueryTypeDescriptorpublic void valueTypeName(String valTypeName)
valTypeName - Value type name.public void addProperty(GridQueryProperty prop, boolean failOnDuplicate) throws IgniteCheckedException
prop - Property.failOnDuplicate - Fail on duplicate flag.IgniteCheckedException - In case of error.public void addProperty(GridQueryProperty prop, boolean failOnDuplicate, boolean isField) throws IgniteCheckedException
prop - Property.failOnDuplicate - Fail on duplicate flag.isField - True if prop if field, False if prop is "_KEY" or "_VAL".IgniteCheckedException - In case of error.public void removeProperty(String name) throws IgniteCheckedException
name - Name of a property to remove.IgniteCheckedExceptionpublic void schemaName(String schemaName)
schemaName - Schema name.public boolean valueTextIndex()
true if string representation of value should be indexed as text.valueTextIndex in interface GridQueryTypeDescriptorpublic void valueTextIndex(boolean valTextIdx)
valTextIdx - Flag value.public String affinityKey()
null for default.affinityKey in interface GridQueryTypeDescriptorpublic void affinityKey(String affKey)
affKey - Affinity key field.public boolean customAffinityKeyMapper()
customAffinityKeyMapper in interface GridQueryTypeDescriptorpublic void customAffinityKeyMapper(boolean customAffKeyMapper)
customAffKeyMapper - Whether custom affinity key mapper is set.public boolean obsolete()
True if obsolete.public void markObsolete()
public String keyFieldName()
keyFieldName in interface GridQueryTypeDescriptorpublic String valueFieldName()
valueFieldName in interface GridQueryTypeDescriptor@Nullable public @Nullable String keyFieldAlias()
keyFieldAlias in interface GridQueryTypeDescriptor@Nullable public @Nullable String valueFieldAlias()
valueFieldAlias in interface GridQueryTypeDescriptorpublic void validateKeyAndValue(Object key, Object val) throws IgniteCheckedException
validateKeyAndValue in interface GridQueryTypeDescriptorkey - Key.val - Value.IgniteCheckedExceptionpublic void setDefaults(Object key, Object val) throws IgniteCheckedException
setDefaults in interface GridQueryTypeDescriptorkey - Key.val - Value.IgniteCheckedException - If failed.public Set<String> primaryKeyFields()
primaryKeyFields in interface GridQueryTypeDescriptorpublic void primaryKeyFields(Set<String> keys)
primaryKeyFields in interface GridQueryTypeDescriptorkeys - Primary keys.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021