Class OPropertyIndexDefinition
java.lang.Object
com.orientechnologies.orient.core.index.OAbstractIndexDefinition
com.orientechnologies.orient.core.index.OPropertyIndexDefinition
- All Implemented Interfaces:
OIndexCallback,OIndexDefinition
- Direct Known Subclasses:
OPropertyListIndexDefinition,OPropertyMapIndexDefinition,OPropertyRidBagIndexDefinition
Index implementation bound to one schema class property.
-
Field Summary
FieldsFields inherited from class com.orientechnologies.orient.core.index.OAbstractIndexDefinition
collate, document -
Constructor Summary
ConstructorsConstructorDescriptionConstructor used for index unmarshalling.OPropertyIndexDefinition(String iClassName, String iField, OType iType) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuildercreateIndexDDLWithFieldType(String indexName, String indexType, String engine) protected StringBuildercreateIndexDDLWithoutFieldType(String indexName, String indexType, String engine) createValue(Object... params) Calculates key value by passed in parameters.createValue(List<?> params) Calculates key value by passed in parameters.booleanvoidfromStream(ODocument document) Deserialize internal index state from document.getDocumentValueToIndex(ODocument iDocument) intReturns amount of parameters that are used to calculate key value.OType[]getTypes()Return types of values from which index key consist.inthashCode()booleanprotected voidprotected voidprotected voidprotected voidtoCreateIndexDDL(String indexName, String indexType, String engine) final ODocumenttoStream()Serializes internal index state to document.toString()Methods inherited from class com.orientechnologies.orient.core.index.OAbstractIndexDefinition
getCollate, isNullValuesIgnored, setCollate, setCollate, setNullValuesIgnored
-
Field Details
-
className
-
field
-
keyType
-
-
Constructor Details
-
OPropertyIndexDefinition
-
OPropertyIndexDefinition
public OPropertyIndexDefinition()Constructor used for index unmarshalling.
-
-
Method Details
-
getClassName
- Returns:
- Name of the class which this index belongs to.
-
getFields
- Returns:
- Names of fields which given index is used to calculate key value. Order of fields is important.
-
getFieldsToIndex
- 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.
-
getDocumentValueToIndex
-
equals
Description copied from interface:OIndexDefinition- Specified by:
equalsin interfaceOIndexDefinition- Overrides:
equalsin classOAbstractIndexDefinition
-
hashCode
public int hashCode()Description copied from interface:OIndexDefinition- Specified by:
hashCodein interfaceOIndexDefinition- Overrides:
hashCodein classOAbstractIndexDefinition
-
toString
Description copied from interface:OIndexDefinition- Specified by:
toStringin interfaceOIndexDefinition- Overrides:
toStringin classObject
-
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.- Parameters:
params- Parameters from which index key will be calculated.- Returns:
- Key value or null if calculation is impossible.
-
createValue
Calculates key value by passed in parameters.If it is impossible to calculate key value by given parameters
nullwill be returned.- Parameters:
params- Parameters from which index key will be calculated.- Returns:
- Key value or null if calculation is impossible.
-
getParamCount
public int getParamCount()Description copied from interface:OIndexDefinitionReturns amount of parameters that are used to calculate key value. It does not mean that all parameters should be supplied. It only means that if you provide more parameters they will be ignored and will not participate in index key calculation.- Returns:
- Amount of that are used to calculate key value. Call result should be equals to
getTypes().length.
-
getTypes
Description copied from interface:OIndexDefinitionReturn types of values from which index key consist. In case of index that is built on single document property value single array that contains property type will be returned. In case of composite indexes result will contain several key types.- Returns:
- Types of values from which index key consist.
-
fromStream
Description copied from interface:OIndexDefinitionDeserialize internal index state from document.- Parameters:
document- Serialized index presentation.
-
toStream
Description copied from interface:OIndexDefinitionSerializes internal index state to document.- Returns:
- Document that contains internal index state.
-
serializeToStream
protected void serializeToStream()- Overrides:
serializeToStreamin classOAbstractIndexDefinition
-
serializeFromStream
protected void serializeFromStream()- Overrides:
serializeFromStreamin classOAbstractIndexDefinition
-
toCreateIndexDDL
- Parameters:
indexName-indexType-
-
createIndexDDLWithFieldType
protected StringBuilder createIndexDDLWithFieldType(String indexName, String indexType, String engine) -
createIndexDDLWithoutFieldType
protected StringBuilder createIndexDDLWithoutFieldType(String indexName, String indexType, String engine) -
processAdd
-
processRemoval
-
isAutomatic
public boolean isAutomatic()
-