Package org.dizitart.no2.migration
Interface RepositoryInstruction
public interface RepositoryInstruction
Represents a migration instruction set for
ObjectRepository.- Since:
- 4.0
- Author:
- Anindya Chatterjee
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> RepositoryInstructionAdds an instruction to add new field to the entity in theObjectRepository.default <T> RepositoryInstructionAdds an instruction to add new field with value generator, into the entity in theObjectRepository.default <T> RepositoryInstructionAdds an instruction to add new field with a default value, into the entity in theObjectRepository.voidaddStep(MigrationStep step) Adds a migration step to the instruction set.default RepositoryInstructionchangeDataType(String fieldName, TypeConverter<?, ?> converter) Adds an instruction to change the datatype of a field of the entity in theObjectRepository.default RepositoryInstructionchangeIdField(List<String> oldFieldNames, List<String> newFieldNames) Adds an instruction to change the id field of an entity in theObjectRepositorydefault RepositoryInstructionchangeIdField(Fields oldField, Fields newField) Adds an instruction to change the id field of an entity in theObjectRepositorydefault RepositoryInstructioncreateIndex(String indexType, String... fieldNames) Adds an instruction to create an index in theObjectRepository.default RepositoryInstructiondeleteField(String fieldName) Adds an instruction to delete a field from the entity in theObjectRepository.default RepositoryInstructionAdds an instruction to drop all indices from theObjectRepository.default RepositoryInstructionAdds an instruction to drop an index from theObjectRepository.The entity name of theObjectRepository.key()The key of theObjectRepository.default RepositoryInstructionrenameField(String oldName, String newName) Adds an instruction to rename a field to the entity in theObjectRepository.default RepositoryInstructionrenameRepository(String entityName, String key) Adds an instruction to rename theObjectRepository.
-
Method Details
-
renameRepository
Adds an instruction to rename theObjectRepository.- Parameters:
entityName- the entity namekey- the key- Returns:
- the repository instruction
-
addField
Adds an instruction to add new field to the entity in theObjectRepository.- Type Parameters:
T- the type parameter- Parameters:
fieldName- the field name- Returns:
- the repository instruction
-
addField
Adds an instruction to add new field with a default value, into the entity in theObjectRepository.- Type Parameters:
T- the type parameter- Parameters:
fieldName- the field namedefaultValue- the default value- Returns:
- the repository instruction
-
addField
Adds an instruction to add new field with value generator, into the entity in theObjectRepository.- Type Parameters:
T- the type parameter- Parameters:
fieldName- the field namegenerator- the generator- Returns:
- the repository instruction
-
renameField
Adds an instruction to rename a field to the entity in theObjectRepository.- Parameters:
oldName- the old namenewName- the new name- Returns:
- the repository instruction
-
deleteField
Adds an instruction to delete a field from the entity in theObjectRepository.- Parameters:
fieldName- the field name- Returns:
- the repository instruction
-
changeDataType
Adds an instruction to change the datatype of a field of the entity in theObjectRepository.- Parameters:
fieldName- the field nameconverter- the converter- Returns:
- the repository instruction
-
changeIdField
Adds an instruction to change the id field of an entity in theObjectRepository- Parameters:
oldFieldNames- the old field namesnewFieldNames- the new field names- Returns:
- the repository instruction
-
changeIdField
Adds an instruction to change the id field of an entity in theObjectRepository- Parameters:
oldField- the old field namesnewField- the new field names- Returns:
- the repository instruction
-
dropIndex
Adds an instruction to drop an index from theObjectRepository.- Parameters:
fieldNames- the field names- Returns:
- the repository instruction
-
dropAllIndices
Adds an instruction to drop all indices from theObjectRepository.- Returns:
- the repository instruction
-
createIndex
Adds an instruction to create an index in theObjectRepository.- Parameters:
indexType- the index typefieldNames- the field names- Returns:
- the repository instruction
-
entityName
String entityName()The entity name of theObjectRepository.- Returns:
- the string
-
key
String key()The key of theObjectRepository.- Returns:
- the string
-
addStep
Adds a migration step to the instruction set.- Parameters:
step- the step
-