public class QueryTypeDescriptorImpl extends Object implements GridQueryTypeDescriptor
Constructor and Description |
---|
QueryTypeDescriptorImpl(String space)
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.
|
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) |
void |
dropIndex(String idxName)
Drop index.
|
Map<String,Class<?>> |
fields()
Gets mapping from field name to its type.
|
boolean |
hasField(String field)
Chedk if particular field exists.
|
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.
|
String |
keyFieldName()
Gets key field name.
|
void |
keyFieldName(String keyFieldName)
Sets key field name.
|
String |
keyTypeName()
Gets key type name.
|
void |
keyTypeName(String keyTypeName)
Set key type name.
|
void |
markObsolete()
Mark index as obsolete.
|
String |
name()
Gets type name which uniquely identifies this type.
|
void |
name(String name)
Sets type name.
|
boolean |
obsolete() |
Map<String,GridQueryProperty> |
properties() |
GridQueryProperty |
property(String name) |
void |
setValue(String field,
Object key,
Object val,
Object propVal)
Sets field value for given key and value.
|
String |
space() |
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) |
<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.
|
String |
valueFieldName()
Gets value field name.
|
void |
valueFieldName(String valueFieldName)
Sets 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 space)
space
- Cache name.public String space()
public String name()
name
in interface GridQueryTypeDescriptor
public void name(String name)
name
- Name.public String tableName()
tableName
in interface GridQueryTypeDescriptor
public void tableName(String tblName)
tblName
- Table name.public Map<String,Class<?>> fields()
fields
in interface GridQueryTypeDescriptor
public GridQueryProperty property(String name)
property
in interface GridQueryTypeDescriptor
name
- Property name.public Map<String,GridQueryProperty> properties()
public <T> T value(String field, Object key, Object val) throws IgniteCheckedException
value
in interface GridQueryTypeDescriptor
field
- 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 GridQueryTypeDescriptor
field
- Field name.key
- Key.val
- Value.propVal
- Value for given field.IgniteCheckedException
- If failed.public Map<String,GridQueryIndexDescriptor> indexes()
indexes
in interface GridQueryTypeDescriptor
public int typeId()
typeId
in interface GridQueryTypeDescriptor
public void typeId(int typeId)
typeId
- Type ID.@Nullable public QueryIndexDescriptorImpl index(String name)
name
- Name.public Collection<QueryIndexDescriptorImpl> indexes0()
public GridQueryIndexDescriptor textIndex()
textIndex
in interface GridQueryTypeDescriptor
null
.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 GridQueryTypeDescriptor
public void valueClass(Class<?> valCls)
valCls
- Value class.public Class<?> keyClass()
keyClass
in interface GridQueryTypeDescriptor
public void keyClass(Class<?> keyCls)
keyCls
- Key class.public String keyTypeName()
keyTypeName
in interface GridQueryTypeDescriptor
public void keyTypeName(String keyTypeName)
keyTypeName
- Key type name.public String valueTypeName()
valueTypeName
in interface GridQueryTypeDescriptor
public 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 boolean valueTextIndex()
true
if string representation of value should be indexed as text.valueTextIndex
in interface GridQueryTypeDescriptor
public void valueTextIndex(boolean valTextIdx)
valTextIdx
- Flag value.public String affinityKey()
null
for default.affinityKey
in interface GridQueryTypeDescriptor
public void affinityKey(String affKey)
affKey
- Affinity key field.public boolean obsolete()
True
if obsolete.public void markObsolete()
public void keyFieldName(String keyFieldName)
keyFieldName
- Key field name.public String keyFieldName()
keyFieldName
in interface GridQueryTypeDescriptor
public void valueFieldName(String valueFieldName)
valueFieldName
- value field name.public String valueFieldName()
valueFieldName
in interface GridQueryTypeDescriptor
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017