Class GridQueryRowDescriptorImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.GridQueryRowDescriptorImpl
-
- All Implemented Interfaces:
GridQueryRowDescriptor
public class GridQueryRowDescriptorImpl extends Object implements GridQueryRowDescriptor
Row descriptor.
-
-
Field Summary
Fields Modifier and Type Field Description static intCOL_NOT_EXISTSNon existent column.
-
Constructor Summary
Constructors Constructor Description GridQueryRowDescriptorImpl(GridCacheContextInfo<?,?> cacheInfo, GridQueryTypeDescriptor type)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable GridCacheContext<?,?>context()Gets cache context for this row descriptor.intfieldsCount()intgetAlternativeColumnId(int colId)Gets alternative column id that may substitute the given column id.ObjectgetFieldValue(Object key, Object val, int fieldIdx)Gets field value by field index.Set<String>getRowKeyColumnNames()Gets a copy of a set of table key column names.booleanisFieldKeyProperty(int fieldIdx)Determine whether a field corresponds to a property of key or to one of value.booleanisKeyColumn(int colId)Checks if provided column id matches key column or key alias.booleanisValueColumn(int colId)Checks if provided column id matches value column or alias.voidonMetadataUpdated()Callback for table metadata update event.voidsetFieldValue(Object key, Object val, Object fieldVal, int fieldIdx)Sets field value by field index.GridQueryTypeDescriptortype()Gets type descriptor.
-
-
-
Field Detail
-
COL_NOT_EXISTS
public static final int COL_NOT_EXISTS
Non existent column.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GridQueryRowDescriptorImpl
public GridQueryRowDescriptorImpl(GridCacheContextInfo<?,?> cacheInfo, GridQueryTypeDescriptor type)
Constructor.- Parameters:
cacheInfo- Cache context.type- Type descriptor.
-
-
Method Detail
-
onMetadataUpdated
public final void onMetadataUpdated()
Callback for table metadata update event.- Specified by:
onMetadataUpdatedin interfaceGridQueryRowDescriptor
-
type
public GridQueryTypeDescriptor type()
Gets type descriptor.- Specified by:
typein interfaceGridQueryRowDescriptor- Returns:
- Type descriptor.
-
context
@Nullable public @Nullable GridCacheContext<?,?> context()
Gets cache context for this row descriptor.- Specified by:
contextin interfaceGridQueryRowDescriptor- Returns:
- Cache context.
-
fieldsCount
public int fieldsCount()
- Specified by:
fieldsCountin interfaceGridQueryRowDescriptor- Returns:
- Total fields count.
-
getFieldValue
public Object getFieldValue(Object key, Object val, int fieldIdx)
Gets field value by field index.- Specified by:
getFieldValuein interfaceGridQueryRowDescriptor- Parameters:
key- Key.val- Value.fieldIdx- Field index.- Returns:
- Field value.
-
setFieldValue
public void setFieldValue(Object key, Object val, Object fieldVal, int fieldIdx)
Sets field value by field index.- Specified by:
setFieldValuein interfaceGridQueryRowDescriptor- Parameters:
key- Key.val- Value.fieldVal- Value to set to field.fieldIdx- Field index.
-
isFieldKeyProperty
public boolean isFieldKeyProperty(int fieldIdx)
Determine whether a field corresponds to a property of key or to one of value.- Specified by:
isFieldKeyPropertyin interfaceGridQueryRowDescriptor- Parameters:
fieldIdx- Field index.- Returns:
trueif given field corresponds to a key property,falseotherwise.
-
isKeyColumn
public boolean isKeyColumn(int colId)
Checks if provided column id matches key column or key alias.- Specified by:
isKeyColumnin interfaceGridQueryRowDescriptor- Parameters:
colId- Column id.- Returns:
- Result.
-
isValueColumn
public boolean isValueColumn(int colId)
Checks if provided column id matches value column or alias.- Specified by:
isValueColumnin interfaceGridQueryRowDescriptor- Parameters:
colId- Column id.- Returns:
- Result.
-
getAlternativeColumnId
public int getAlternativeColumnId(int colId)
Gets alternative column id that may substitute the given column id. For alias column returns original one. For original column returns its alias. Otherwise, returns the given column id.- Specified by:
getAlternativeColumnIdin interfaceGridQueryRowDescriptor- Parameters:
colId- Column id.- Returns:
- Result.
-
getRowKeyColumnNames
public Set<String> getRowKeyColumnNames()
Gets a copy of a set of table key column names.- Specified by:
getRowKeyColumnNamesin interfaceGridQueryRowDescriptor- Returns:
- Set of a table key column names.
-
-