Interface OIndexDefinition

All Superinterfaces:
OIndexCallback
All Known Subinterfaces:
OIndexDefinitionMultiValue
All Known Implementing Classes:
OAbstractIndexDefinition, OCompositeIndexDefinition, OPropertyIndexDefinition, OPropertyListIndexDefinition, OPropertyMapIndexDefinition, OPropertyRidBagIndexDefinition, ORuntimeKeyIndexDefinition, OSimpleKeyIndexDefinition

public interface OIndexDefinition extends OIndexCallback
Presentation of index that is used information and contained in document OClass .

This object cannot be created directly, use OClass manipulation method instead.

Author:
Andrey Lomakin (a.lomakin-at-orientdb.com), Artem Orobets
  • Method Details

    • getFields

      List<String> getFields()
      Returns:
      Names of fields which given index is used to calculate key value. Order of fields is important.
    • getFieldsToIndex

      List<String> getFieldsToIndex()
      Returns:
      Names of fields and their index modifiers (like "by value" for fields that hold Map values) which given index is used to calculate key value. Order of fields is important.
    • getClassName

      String getClassName()
      Returns:
      Name of the class which this index belongs to.
    • equals

      boolean equals(Object index)
      Overrides:
      equals in class Object
    • hashCode

      int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      String toString()
      Overrides:
      toString in class Object
    • createValue

      Object createValue(List<?> params)
      Calculates key value by passed in parameters.

      If it is impossible to calculate key value by given parameters null will be returned.

      Parameters:
      params - Parameters from which index key will be calculated.
      Returns:
      Key value or null if calculation is impossible.
    • createValue

      Object createValue(Object... params)
      Calculates key value by passed in parameters.

      If it is impossible to calculate key value by given parameters null will be returned.

      Parameters:
      params - Parameters from which index key will be calculated.
      Returns:
      Key value or null if calculation is impossible.
    • getParamCount

      int getParamCount()
      Returns 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

      OType[] getTypes()
      Return 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.
    • toStream

      ODocument toStream()
      Serializes internal index state to document.
      Returns:
      Document that contains internal index state.
    • fromStream

      void fromStream(ODocument document)
      Deserialize internal index state from document.
      Parameters:
      document - Serialized index presentation.
    • toCreateIndexDDL

      String toCreateIndexDDL(String indexName, String indexType, String engine)
    • isAutomatic

      boolean isAutomatic()
    • getCollate

      OCollate getCollate()
    • setCollate

      void setCollate(OCollate collate)
    • isNullValuesIgnored

      boolean isNullValuesIgnored()
    • setNullValuesIgnored

      void setNullValuesIgnored(boolean value)