Class OPropertyMapIndexDefinition
java.lang.Object
com.orientechnologies.orient.core.index.OAbstractIndexDefinition
com.orientechnologies.orient.core.index.OPropertyIndexDefinition
com.orientechnologies.orient.core.index.OPropertyMapIndexDefinition
- All Implemented Interfaces:
OIndexCallback,OIndexDefinition,OIndexDefinitionMultiValue
public class OPropertyMapIndexDefinition
extends OPropertyIndexDefinition
implements OIndexDefinitionMultiValue
Index implementation bound to one schema class property that presents
or-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIndicates whether Map will be indexed using its keys or values. -
Field Summary
Fields inherited from class com.orientechnologies.orient.core.index.OPropertyIndexDefinition
className, field, keyTypeFields inherited from class com.orientechnologies.orient.core.index.OAbstractIndexDefinition
collate, document -
Constructor Summary
ConstructorsConstructorDescriptionOPropertyMapIndexDefinition(String iClassName, String iField, OType iType, OPropertyMapIndexDefinition.INDEX_BY indexBy) -
Method Summary
Modifier and TypeMethodDescriptioncreateSingleValue(Object... param) Converts passed in value in the key of single index entry.createValue(Object... params) Calculates key value by passed in parameters.createValue(List<?> params) Calculates key value by passed in parameters.booleangetDocumentValueToIndex(ODocument iDocument) inthashCode()voidprocessChangeEvent(OMultiValueChangeEvent<?, ?> changeEvent, Map<Object, Integer> keysToAdd, Map<Object, Integer> keysToRemove) Process event that contains operation on collection and extract values that should be added removed from index to reflect collection changes in the given index.protected voidprotected voidtoCreateIndexDDL(String indexName, String indexType, String engine) toString()Methods inherited from class com.orientechnologies.orient.core.index.OPropertyIndexDefinition
createIndexDDLWithFieldType, createIndexDDLWithoutFieldType, fromStream, getClassName, getFields, getParamCount, getTypes, isAutomatic, processAdd, processRemoval, toStreamMethods inherited from class com.orientechnologies.orient.core.index.OAbstractIndexDefinition
getCollate, isNullValuesIgnored, setCollate, setCollate, setNullValuesIgnoredMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.orientechnologies.orient.core.index.OIndexDefinition
fromStream, getClassName, getCollate, getFields, getParamCount, getTypes, isAutomatic, isNullValuesIgnored, setCollate, setNullValuesIgnored, toStream
-
Constructor Details
-
OPropertyMapIndexDefinition
public OPropertyMapIndexDefinition() -
OPropertyMapIndexDefinition
public OPropertyMapIndexDefinition(String iClassName, String iField, OType iType, OPropertyMapIndexDefinition.INDEX_BY indexBy)
-
-
Method Details
-
getDocumentValueToIndex
- Specified by:
getDocumentValueToIndexin interfaceOIndexCallback- Overrides:
getDocumentValueToIndexin classOPropertyIndexDefinition
-
createValue
Description copied from interface:OIndexDefinitionCalculates key value by passed in parameters.If it is impossible to calculate key value by given parameters
nullwill be returned.- Specified by:
createValuein interfaceOIndexDefinition- Overrides:
createValuein classOPropertyIndexDefinition- Parameters:
params- Parameters from which index key will be calculated.- Returns:
- Key value or null if calculation is impossible.
-
createValue
Description copied from class:OPropertyIndexDefinitionCalculates key value by passed in parameters.If it is impossible to calculate key value by given parameters
nullwill be returned.- Specified by:
createValuein interfaceOIndexDefinition- Overrides:
createValuein classOPropertyIndexDefinition- Parameters:
params- Parameters from which index key will be calculated.- Returns:
- Key value or null if calculation is impossible.
-
getIndexBy
-
serializeToStream
protected void serializeToStream()- Overrides:
serializeToStreamin classOPropertyIndexDefinition
-
serializeFromStream
protected void serializeFromStream()- Overrides:
serializeFromStreamin classOPropertyIndexDefinition
-
equals
Description copied from interface:OIndexDefinition- Specified by:
equalsin interfaceOIndexDefinition- Overrides:
equalsin classOPropertyIndexDefinition
-
createSingleValue
Description copied from interface:OIndexDefinitionMultiValueConverts passed in value in the key of single index entry.- Specified by:
createSingleValuein interfaceOIndexDefinitionMultiValue- Parameters:
param- Value to convert.- Returns:
- Index key.
-
processChangeEvent
public void processChangeEvent(OMultiValueChangeEvent<?, ?> changeEvent, Map<Object, Integer> keysToAdd, Map<Object, Integer> keysToRemove) Description copied from interface:OIndexDefinitionMultiValueProcess event that contains operation on collection and extract values that should be added removed from index to reflect collection changes in the given index.- Specified by:
processChangeEventin interfaceOIndexDefinitionMultiValue- Parameters:
changeEvent- Event that describes operation that was performed on collection.keysToAdd- Values that should be added to related index.keysToRemove- Values that should be removed to related index.
-
getFieldsToIndex
- Specified by:
getFieldsToIndexin interfaceOIndexDefinition- Overrides:
getFieldsToIndexin classOPropertyIndexDefinition- Returns:
- Names of fields and their index modifiers (like "by value" for fields that hold
Mapvalues) which given index is used to calculate key value. Order of fields is important.
-
hashCode
public int hashCode()Description copied from interface:OIndexDefinition- Specified by:
hashCodein interfaceOIndexDefinition- Overrides:
hashCodein classOPropertyIndexDefinition
-
toString
Description copied from interface:OIndexDefinition- Specified by:
toStringin interfaceOIndexDefinition- Overrides:
toStringin classOPropertyIndexDefinition
-
toCreateIndexDDL
Description copied from class:OPropertyIndexDefinition- Specified by:
toCreateIndexDDLin interfaceOIndexDefinition- Overrides:
toCreateIndexDDLin classOPropertyIndexDefinition
-