Package org.nuiton.topia.migration
Class TopiaMigrationEngine
java.lang.Object
org.nuiton.topia.migration.TopiaMigrationEngine
- All Implemented Interfaces:
TopiaMigrationService,TopiaMigrationService,TopiaService
Deprecated.
no longer maintained since using Hibernate 6 (we could not fix issues using new configuration directives)
and is no longer user. Migrate to Flyway or Liquibase modules.
Le moteur de migration proposé par topia. Il est basé sur un
AbstractTopiaMigrationCallback
qui donne la version de l'application, les version de mises à jour disponibles.
Le call back offre aussi les commandes sql à passer pour chaque version de mise à jour.
FIXME Finir cette documentation- Since:
- 2.3.4
- Author:
- tchemit
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TopiaApplicationContextDeprecated.Topia application context (set during init)protected AbstractTopiaMigrationCallbackDeprecated.CallbackHandler list (set during init)protected booleanDeprecated.A flag to know if none of the dealed entities tables exists in db.protected booleanDeprecated.Drapeau pour savoir si la base est versionnée ou nonprotected org.nuiton.version.VersionDeprecated.Current database version (set during init)protected booleanDeprecated.Flag to know if the service is correctly initializedprotected org.hibernate.boot.MetadataDeprecated.protected org.hibernate.SessionFactoryDeprecated.protected booleanDeprecated.Flag to display progress or notprotected booleanDeprecated.Flag to display SQL requests or notprotected org.hibernate.cfg.ConfigurationDeprecated.Hibernate Configuration only with TMSVersion entity (set during init)protected booleanDeprecated.A flag to check if version was detected in database.protected booleanDeprecated.Flag to know if the TMSVersion table is existing (set during init)Fields inherited from interface org.nuiton.topia.migration.TopiaMigrationService
MIGRATION_CALLBACK, MIGRATION_MIGRATE_ON_INIT, MIGRATION_SHOW_PROGRESSION, MIGRATION_SHOW_SQL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.voidclose()Deprecated.protected static org.hibernate.cfg.ConfigurationDeprecated.Creates the hibernate configuration to be used by the service.protected booleanDeprecated.Detects if there is some schema existing for at least one of the dealed entity of the underlying db context.protected voidDeprecated.static List<org.nuiton.version.Version>filterVersions(Set<org.nuiton.version.Version> versions, org.nuiton.version.Version min, org.nuiton.version.Version max, boolean includeMin, boolean includeMax) Deprecated.Filter versions.protected org.nuiton.version.VersionDeprecated.protected StringgetSafeParameter(Properties config, String key) Deprecated.Deprecated.voidDeprecated.voidinitTopiaService(TopiaApplicationContext topiaApplicationContext, Map<String, String> serviceConfiguration) Deprecated.booleanDeprecated.voidDeprecated.protected voidDeprecated.Save the application's model version in the database.
-
Field Details
-
versionConfiguration
protected org.hibernate.cfg.Configuration versionConfigurationDeprecated.Hibernate Configuration only with TMSVersion entity (set during init) -
versionTableExist
protected boolean versionTableExistDeprecated.Flag to know if the TMSVersion table is existing (set during init) -
dbVersion
protected org.nuiton.version.Version dbVersionDeprecated.Current database version (set during init) -
dbNotVersioned
protected boolean dbNotVersionedDeprecated.Drapeau pour savoir si la base est versionnée ou non -
dbEmpty
protected boolean dbEmptyDeprecated.A flag to know if none of the dealed entities tables exists in db.- Since:
- 2.5.3
-
callback
Deprecated.CallbackHandler list (set during init) -
applicationContext
Deprecated.Topia application context (set during init) -
init
protected boolean initDeprecated.Flag to know if the service is correctly initialized -
versionDetected
protected boolean versionDetectedDeprecated.A flag to check if version was detected in database. This flag is set totrueat the end of methoddetectDbVersion(). -
showSql
protected boolean showSqlDeprecated.Flag to display SQL requests or not -
showProgression
protected boolean showProgressionDeprecated.Flag to display progress or not -
sessionFactory
protected org.hibernate.SessionFactory sessionFactoryDeprecated. -
metaData
protected org.hibernate.boot.Metadata metaDataDeprecated.
-
-
Constructor Details
-
TopiaMigrationEngine
public TopiaMigrationEngine()Deprecated.
-
-
Method Details
-
initTopiaService
public void initTopiaService(TopiaApplicationContext topiaApplicationContext, Map<String, String> serviceConfiguration) Deprecated.- Specified by:
initTopiaServicein interfaceTopiaService
-
migrateSchema
Deprecated.- Specified by:
migrateSchemain interfaceTopiaMigrationService- Throws:
MigrationServiceException
-
getSchemaVersion
Deprecated.- Specified by:
getSchemaVersionin interfaceTopiaMigrationService- Throws:
TopiaMigrationServiceException
-
initOnCreateSchema
public void initOnCreateSchema()Deprecated.- Specified by:
initOnCreateSchemain interfaceTopiaMigrationService
-
filterVersions
public static List<org.nuiton.version.Version> filterVersions(Set<org.nuiton.version.Version> versions, org.nuiton.version.Version min, org.nuiton.version.Version max, boolean includeMin, boolean includeMax) Deprecated.Filter versions.- Parameters:
versions- versions to filtermin- min version to acceptmax- max version to acceptincludeMin- flag to include min versionincludeMax- flag to include max version- Returns:
- versions between min and max
-
runSchemaMigration
public void runSchemaMigration()Deprecated.- Specified by:
runSchemaMigrationin interfaceTopiaMigrationService
-
saveApplicationVersion
protected void saveApplicationVersion()Deprecated.Save the application's model version in the database. -
getApplicationVersion
protected org.nuiton.version.Version getApplicationVersion()Deprecated. -
detectDbVersion
protected void detectDbVersion()Deprecated.Recupere depuis la base les états internes du service : -
detectDbEmpty
protected boolean detectDbEmpty()Deprecated.Detects if there is some schema existing for at least one of the dealed entity of the underlying db context.- Returns:
trueif there is no schema for any of the dealed entities,falseotherwise.- Since:
- 2.5.3
-
getSafeParameter
Deprecated. -
checkInit
protected void checkInit()Deprecated. -
createTMSHibernateConfiguration
protected static org.hibernate.cfg.Configuration createTMSHibernateConfiguration(TopiaApplicationContext appContext) Deprecated.Creates the hibernate configuration to be used by the service.- Parameters:
appContext- the topia application context used to copy database credentials- Since:
- 2.5.3
-
close
public void close()Deprecated.- Specified by:
closein interfaceTopiaService
-