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

public class OPropertyIndexDefinition extends OAbstractIndexDefinition
Index implementation bound to one schema class property.
  • Field Details

    • className

      protected String className
    • field

      protected String field
    • keyType

      protected OType keyType
  • Constructor Details

    • OPropertyIndexDefinition

      public OPropertyIndexDefinition(String iClassName, String iField, OType iType)
    • OPropertyIndexDefinition

      public OPropertyIndexDefinition()
      Constructor used for index unmarshalling.
  • Method Details

    • getClassName

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

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

      public 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.
    • getDocumentValueToIndex

      public Object getDocumentValueToIndex(ODocument iDocument)
    • equals

      public boolean equals(Object o)
      Description copied from interface: OIndexDefinition
      Specified by:
      equals in interface OIndexDefinition
      Overrides:
      equals in class OAbstractIndexDefinition
    • hashCode

      public int hashCode()
      Description copied from interface: OIndexDefinition
      Specified by:
      hashCode in interface OIndexDefinition
      Overrides:
      hashCode in class OAbstractIndexDefinition
    • toString

      public String toString()
      Description copied from interface: OIndexDefinition
      Specified by:
      toString in interface OIndexDefinition
      Overrides:
      toString in class Object
    • createValue

      public Object createValue(List<?> params)
      Description copied from interface: OIndexDefinition
      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

      public 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

      public int getParamCount()
      Description copied from interface: OIndexDefinition
      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

      public OType[] getTypes()
      Description copied from interface: OIndexDefinition
      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.
    • fromStream

      public void fromStream(ODocument document)
      Description copied from interface: OIndexDefinition
      Deserialize internal index state from document.
      Parameters:
      document - Serialized index presentation.
    • toStream

      public final ODocument toStream()
      Description copied from interface: OIndexDefinition
      Serializes internal index state to document.
      Returns:
      Document that contains internal index state.
    • serializeToStream

      protected void serializeToStream()
      Overrides:
      serializeToStream in class OAbstractIndexDefinition
    • serializeFromStream

      protected void serializeFromStream()
      Overrides:
      serializeFromStream in class OAbstractIndexDefinition
    • toCreateIndexDDL

      public String toCreateIndexDDL(String indexName, String indexType, String engine)
      Parameters:
      indexName -
      indexType -
    • createIndexDDLWithFieldType

      protected StringBuilder createIndexDDLWithFieldType(String indexName, String indexType, String engine)
    • createIndexDDLWithoutFieldType

      protected StringBuilder createIndexDDLWithoutFieldType(String indexName, String indexType, String engine)
    • processAdd

      protected void processAdd(Object value, Map<Object,Integer> keysToAdd, Map<Object,Integer> keysToRemove)
    • processRemoval

      protected void processRemoval(Object value, Map<Object,Integer> keysToAdd, Map<Object,Integer> keysToRemove)
    • isAutomatic

      public boolean isAutomatic()