Enum Class Phase
- All Implemented Interfaces:
Serializable,Comparable<Phase>,Constable
Each phase is associated with a specific trigger that causes its execution. Furthermore, each
phase defines the possible transitions to subsequent phases via the transitionTo()
method.
The phases are executed in the following order:
- Since:
- 4.14
- Author:
- Eike Stepper
- No Implement
- This package is currently considered provisional.
- No Extend
- This package is currently considered provisional.
- No Reference
- This package is currently considered provisional.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA handler for a specific phase in the model evolution process.static enumThe possible transitions between phases.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe change detection phase identifies model changes between the stored models and the currently registered EPackages.The repository export phase exports the current repository data to theevolution folderbefore any schema migration takes place.The repository processing phase processes the repository after the schema migration has taken place.The schema migration phase migrates the database schema to match the currently registered EPackages.The store processing phase processes the DB store after the schema migration has taken place. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after executing a phase handler.protected abstract Phase.TransitiongetTransitionTo(Phase nextPhase) voidCalled before executing a phase handler.booleaninitial()Returns true if this is the initial phase in the model evolution process.next()Returns the next phase in the model evolution process, ornullif this is the terminal phase.static PhaseParses the given string into a Phase.transitionTo(Phase nextPhase) trigger()Returns thetriggerthat causes the execution of this phase.static PhaseReturns the enum constant of this class with the specified name.static Phase[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ChangeDetection
The change detection phase identifies model changes between the stored models and the currently registered EPackages.This phase is triggered by the
activating storeevent.From this phase, transitions are possible to:
RepositoryExportvia thenext triggertransitionSchemaMigrationvia thesame triggertransition
The change detection phase is always the initial phase in the model evolution process. It is also the only phase that can be cancelled, for example, if no model changes are detected.
-
RepositoryExport
The repository export phase exports the current repository data to theevolution folderbefore any schema migration takes place.This phase is triggered by the
activated repositoryevent. At this point in time, the repository is fully configured and active. The repository's package registry is filled with the old models.From this phase, a transition is possible to:
SchemaMigrationvia therepository restarttransition
The repository export phase, if applicable, is always the second phase in the model evolution process. It is only executed if model changes were detected during the
change detectionphase and aphase handlerwas registered for this phase. -
SchemaMigration
The schema migration phase migrates the database schema to match the currently registered EPackages. It also performs any necessary data migrations, such as updating thecdo_featurecolumns when feature IDs have changed or updating enum literal values when enum literals have changed.This phase is triggered by the
activating storeevent.From this phase, transitions are possible to:
StoreProcessingvia thestore restarttransitionRepositoryProcessingvia thestore restarttransition
The schema migration phase is always executed (i.e., a
phase handlermust be registered for it) when model changes were detected during thechange detectionphase. -
StoreProcessing
The store processing phase processes the DB store after the schema migration has taken place. This phase is typically used to perform any necessary adjustments to the stored data to ensure consistency with the new schema.This phase is triggered by the
activating storeevent. At this point in time, the DB store is fully configured, but not yet active. The repository's package registry is filled with the new models. The store's mapping registry has been updated to match the new models.From this phase, a transition is possible to:
RepositoryProcessingvia thenext triggertransition
The store processing phase is only executed if a
phase handlerwas registered for it. -
RepositoryProcessing
The repository processing phase processes the repository after the schema migration has taken place. This phase is typically used to perform any necessary adjustments to the repository data.This phase is triggered by the
activated repositoryevent. At this point in time, the repository is fully configured and active. The repository's package registry is filled with the new models.This is the terminal phase in the model evolution process. It is only executed if a
phase handlerwas registered for it.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
initial
public boolean initial()Returns true if this is the initial phase in the model evolution process. The initial phase is alwaysChangeDetection. -
next
Returns the next phase in the model evolution process, ornullif this is the terminal phase. The terminal phase is alwaysRepositoryProcessing. -
trigger
Returns thetriggerthat causes the execution of this phase. -
transitionTo
-
getTransitionTo
-
init
Called before executing a phase handler. -
done
Called after executing a phase handler. -
parse
Parses the given string into a Phase.
-