Class HibernateDataMigrationManager
- java.lang.Object
-
- com.xpn.xwiki.store.migration.AbstractDataMigrationManager
-
- com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager
-
- All Implemented Interfaces:
DataMigrationManager
,org.xwiki.component.phase.Initializable
@Component @Named("hibernate") @Singleton public class HibernateDataMigrationManager extends AbstractDataMigrationManager
Migration manager for hibernate store.- Since:
- 3.4M1
- Version:
- $Id: 8f65a42040ea99a624ceb2487a2c724308ee69e5 $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.xpn.xwiki.store.migration.AbstractDataMigrationManager
AbstractDataMigrationManager.XWikiMigration
-
-
Field Summary
Fields Modifier and Type Field Description static String
CHANGELOG_NAME
Name for which the change log is served.-
Fields inherited from class com.xpn.xwiki.store.migration.AbstractDataMigrationManager
componentManager, hibernateConfiguration, logger, migrations, observationManager, progress
-
-
Constructor Summary
Constructors Constructor Description HibernateDataMigrationManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<? extends DataMigration>
getAllMigrations()
XWikiHibernateBaseStore
getBaseStore()
XWikiDBVersion
getDBVersionFromDatabase()
Read data version from database.protected void
initializeEmptyDB()
protected void
setDBVersionToDatabase(XWikiDBVersion version)
protected void
startMigrations()
Start the migration process.protected void
updateSchema(Collection<AbstractDataMigrationManager.XWikiMigration> migrations)
Update database schema to the latest structure.-
Methods inherited from class com.xpn.xwiki.store.migration.AbstractDataMigrationManager
checkDatabase, getDataMigrationStatus, getDBVersion, getDBVersionFromConfig, getForcedMigrations, getLatestVersion, getMainXWiki, getNeededMigrations, getVirtualWikisDatabaseNames, getXWikiConfig, getXWikiContext, initialize, initNewDB, isVirtualMode, setDBVersion, startMigrations
-
-
-
-
Field Detail
-
CHANGELOG_NAME
public static final String CHANGELOG_NAME
Name for which the change log is served.- See Also:
- Constant Field Values
-
-
Method Detail
-
getBaseStore
public XWikiHibernateBaseStore getBaseStore() throws DataMigrationException
- Returns:
- store system for execute store-specific actions.
- Throws:
DataMigrationException
- if the store could not be reached
-
getDBVersionFromDatabase
public XWikiDBVersion getDBVersionFromDatabase() throws DataMigrationException
Description copied from class:AbstractDataMigrationManager
Read data version from database.- Overrides:
getDBVersionFromDatabase
in classAbstractDataMigrationManager
- Returns:
- data version or null if this is a new database
- Throws:
DataMigrationException
- in case of an unexpected error
-
initializeEmptyDB
protected void initializeEmptyDB() throws DataMigrationException
- Specified by:
initializeEmptyDB
in classAbstractDataMigrationManager
- Throws:
DataMigrationException
- if any error
-
setDBVersionToDatabase
protected void setDBVersionToDatabase(XWikiDBVersion version) throws DataMigrationException
- Specified by:
setDBVersionToDatabase
in classAbstractDataMigrationManager
- Parameters:
version
- to set- Throws:
DataMigrationException
- if any error
-
updateSchema
protected void updateSchema(Collection<AbstractDataMigrationManager.XWikiMigration> migrations) throws DataMigrationException
Description copied from class:AbstractDataMigrationManager
Update database schema to the latest structure.- Specified by:
updateSchema
in classAbstractDataMigrationManager
- Parameters:
migrations
- the migration that will be executed (since 4.0M1)- Throws:
DataMigrationException
- if any error
-
startMigrations
protected void startMigrations() throws DataMigrationException
Description copied from class:AbstractDataMigrationManager
Start the migration process. This one is not thread safe and should be synchronized. The migrations field should not be null.- Overrides:
startMigrations
in classAbstractDataMigrationManager
- Throws:
DataMigrationException
- in case of any error
-
getAllMigrations
protected List<? extends DataMigration> getAllMigrations() throws DataMigrationException
- Specified by:
getAllMigrations
in classAbstractDataMigrationManager
- Returns:
- List of all
DataMigration
for this manager - Throws:
DataMigrationException
- if any error
-
-