Interface RepositoryInstruction


public interface RepositoryInstruction
Represents a migration instruction set for ObjectRepository.
Since:
4.0
Author:
Anindya Chatterjee
  • Method Details

    • renameRepository

      default RepositoryInstruction renameRepository(String entityName, String key)
      Adds an instruction to rename the ObjectRepository.
      Parameters:
      entityName - the entity name
      key - the key
      Returns:
      the repository instruction
    • addField

      default <T> RepositoryInstruction addField(String fieldName)
      Adds an instruction to add new field to the entity in the ObjectRepository.
      Type Parameters:
      T - the type parameter
      Parameters:
      fieldName - the field name
      Returns:
      the repository instruction
    • addField

      default <T> RepositoryInstruction addField(String fieldName, T defaultValue)
      Adds an instruction to add new field with a default value, into the entity in the ObjectRepository.
      Type Parameters:
      T - the type parameter
      Parameters:
      fieldName - the field name
      defaultValue - the default value
      Returns:
      the repository instruction
    • addField

      default <T> RepositoryInstruction addField(String fieldName, Generator<T> generator)
      Adds an instruction to add new field with value generator, into the entity in the ObjectRepository.
      Type Parameters:
      T - the type parameter
      Parameters:
      fieldName - the field name
      generator - the generator
      Returns:
      the repository instruction
    • renameField

      default RepositoryInstruction renameField(String oldName, String newName)
      Adds an instruction to rename a field to the entity in the ObjectRepository.
      Parameters:
      oldName - the old name
      newName - the new name
      Returns:
      the repository instruction
    • deleteField

      default RepositoryInstruction deleteField(String fieldName)
      Adds an instruction to delete a field from the entity in the ObjectRepository.
      Parameters:
      fieldName - the field name
      Returns:
      the repository instruction
    • changeDataType

      default RepositoryInstruction changeDataType(String fieldName, TypeConverter<?,?> converter)
      Adds an instruction to change the datatype of a field of the entity in the ObjectRepository.
      Parameters:
      fieldName - the field name
      converter - the converter
      Returns:
      the repository instruction
    • changeIdField

      default RepositoryInstruction changeIdField(List<String> oldFieldNames, List<String> newFieldNames)
      Adds an instruction to change the id field of an entity in the ObjectRepository
      Parameters:
      oldFieldNames - the old field names
      newFieldNames - the new field names
      Returns:
      the repository instruction
    • changeIdField

      default RepositoryInstruction changeIdField(Fields oldField, Fields newField)
      Adds an instruction to change the id field of an entity in the ObjectRepository
      Parameters:
      oldField - the old field names
      newField - the new field names
      Returns:
      the repository instruction
    • dropIndex

      default RepositoryInstruction dropIndex(String... fieldNames)
      Adds an instruction to drop an index from the ObjectRepository.
      Parameters:
      fieldNames - the field names
      Returns:
      the repository instruction
    • dropAllIndices

      default RepositoryInstruction dropAllIndices()
      Adds an instruction to drop all indices from the ObjectRepository.
      Returns:
      the repository instruction
    • createIndex

      default RepositoryInstruction createIndex(String indexType, String... fieldNames)
      Adds an instruction to create an index in the ObjectRepository.
      Parameters:
      indexType - the index type
      fieldNames - the field names
      Returns:
      the repository instruction
    • entityName

      String entityName()
      The entity name of the ObjectRepository.
      Returns:
      the string
    • key

      String key()
      The key of the ObjectRepository.
      Returns:
      the string
    • addStep

      void addStep(MigrationStep step)
      Adds a migration step to the instruction set.
      Parameters:
      step - the step