Class DefaultSchemaMigrator
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.emf.cdo.server.db.evolution.phased.BasicPhaseHandler
org.eclipse.emf.cdo.server.db.evolution.phased.DefaultSchemaMigrator
- All Implemented Interfaces:
Phase.Handler,org.eclipse.net4j.util.event.INotifier,org.eclipse.net4j.util.event.INotifier.INotifier2,org.eclipse.net4j.util.lifecycle.IDeactivateable,org.eclipse.net4j.util.lifecycle.ILifecycle,org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
Evolves the models with the given mapping strategy, context, and store accessor.
This method performs the following steps:
- It delegates the model evolution to the mapping strategy, which is responsible for updating the database schema, migrating the existing data, and changing the container feature IDs in case of shifted features.
- It updates the system tables, including the
cdo_package_unitstable,cdo_package_infostable, andcdo_external_refstable. - It commits the transaction.
- 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 classes/interfaces inherited from class org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.event.Notifier.CancelationNested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe factory type of the default schema migrator.Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABELFields inherited from interface org.eclipse.emf.cdo.server.db.evolution.phased.Phase.Handler
PRODUCT_GROUP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancommitChanges(Context context, IDBStoreAccessor accessor) Commits the model evolution changes to the database.voidEvolves the models with the current mapping strategy.booleanReturns whether to delete obsolete meta ID mappings from the cdo_external_refs table.protected voidmigrateSchema(Context context, IDBStoreAccessor accessor, ISchemaMigration schemaMigration) Delegates the schema migration to the mapping strategy.voidsetDeleteObsoleteMetaIDs(boolean deleteObsoleteMetaIDs) Sets whether to delete obsolete meta ID mappings from the cdo_external_refs table.protected voidupdateSystemTables(Context context, IDBStoreAccessor accessor) Updates the system tables with the changed models.Methods inherited from class org.eclipse.emf.cdo.server.db.evolution.phased.BasicPhaseHandler
doBeforeActivate, getPhase, setPhaseMethods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringMethods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Field Details
-
FACTORY_TYPE
The factory type of the default schema migrator.- See Also:
-
-
Constructor Details
-
DefaultSchemaMigrator
public DefaultSchemaMigrator()Creates a schema migrator.
-
-
Method Details
-
isDeleteObsoleteMetaIDs
public boolean isDeleteObsoleteMetaIDs()Returns whether to delete obsolete meta ID mappings from the cdo_external_refs table. -
setDeleteObsoleteMetaIDs
public void setDeleteObsoleteMetaIDs(boolean deleteObsoleteMetaIDs) Sets whether to delete obsolete meta ID mappings from the cdo_external_refs table. -
execute
Evolves the models with the current mapping strategy.- Throws:
Exception
-
migrateSchema
protected void migrateSchema(Context context, IDBStoreAccessor accessor, ISchemaMigration schemaMigration) throws SQLException Delegates the schema migration to the mapping strategy.- Throws:
SQLException
-
updateSystemTables
Updates the system tables with the changed models.- Throws:
SQLException
-
commitChanges
Commits the model evolution changes to the database.- Throws:
SQLException
-