Class OIndexDefinitionFactory

java.lang.Object
com.orientechnologies.orient.core.index.OIndexDefinitionFactory

public class OIndexDefinitionFactory extends Object
Contains helper methods for OIndexDefinition creation.

IMPORTANT: This class designed for internal usage only.

Author:
Artem Orobets
  • Constructor Details

    • OIndexDefinitionFactory

      public OIndexDefinitionFactory()
  • Method Details

    • createIndexDefinition

      public static OIndexDefinition createIndexDefinition(OClass oClass, List<String> fieldNames, List<OType> types, List<OCollate> collates, String indexKind, String algorithm)
      Creates an instance of OIndexDefinition for automatic index.
      Parameters:
      oClass - class which will be indexed
      fieldNames - list of properties which will be indexed. Format should be ' [by key|value]', use 'by key' or 'by value' to describe how to index maps. By default maps indexed by key
      types - types of indexed properties
      collates -
      indexKind -
      algorithm -
      Returns:
      index definition instance
    • extractFieldName

      public static String extractFieldName(String fieldDefinition)
      Extract field name from ' [by key|value]' field format.
      Parameters:
      fieldDefinition - definition of field
      Returns:
      extracted property name
    • createSingleFieldIndexDefinition

      public static OIndexDefinition createSingleFieldIndexDefinition(String className, String fieldName, OType type, OType linkedType, OCollate collate, String indexKind, OPropertyMapIndexDefinition.INDEX_BY indexBy)