Class TopiaMigrationEngine

java.lang.Object
org.nuiton.topia.migration.TopiaMigrationEngine
All Implemented Interfaces:
TopiaMigrationService, TopiaMigrationService, TopiaService

@Deprecated public class TopiaMigrationEngine extends Object implements TopiaMigrationService
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 Details

    • versionConfiguration

      protected org.hibernate.cfg.Configuration versionConfiguration
      Deprecated.
      Hibernate Configuration only with TMSVersion entity (set during init)
    • versionTableExist

      protected boolean versionTableExist
      Deprecated.
      Flag to know if the TMSVersion table is existing (set during init)
    • dbVersion

      protected org.nuiton.version.Version dbVersion
      Deprecated.
      Current database version (set during init)
    • dbNotVersioned

      protected boolean dbNotVersioned
      Deprecated.
      Drapeau pour savoir si la base est versionnée ou non
    • dbEmpty

      protected boolean dbEmpty
      Deprecated.
      A flag to know if none of the dealed entities tables exists in db.
      Since:
      2.5.3
    • callback

      protected AbstractTopiaMigrationCallback callback
      Deprecated.
      CallbackHandler list (set during init)
    • applicationContext

      protected TopiaApplicationContext applicationContext
      Deprecated.
      Topia application context (set during init)
    • init

      protected boolean init
      Deprecated.
      Flag to know if the service is correctly initialized
    • versionDetected

      protected boolean versionDetected
      Deprecated.
      A flag to check if version was detected in database. This flag is set to true at the end of method detectDbVersion().
    • showSql

      protected boolean showSql
      Deprecated.
      Flag to display SQL requests or not
    • showProgression

      protected boolean showProgression
      Deprecated.
      Flag to display progress or not
    • sessionFactory

      protected org.hibernate.SessionFactory sessionFactory
      Deprecated.
    • metaData

      protected org.hibernate.boot.Metadata metaData
      Deprecated.
  • Constructor Details

    • TopiaMigrationEngine

      public TopiaMigrationEngine()
      Deprecated.
  • Method Details

    • initTopiaService

      public void initTopiaService(TopiaApplicationContext topiaApplicationContext, Map<String,String> serviceConfiguration)
      Deprecated.
      Specified by:
      initTopiaService in interface TopiaService
    • migrateSchema

      @Deprecated public boolean migrateSchema() throws MigrationServiceException
      Deprecated.
      Specified by:
      migrateSchema in interface TopiaMigrationService
      Throws:
      MigrationServiceException
    • getSchemaVersion

      public String getSchemaVersion() throws TopiaMigrationServiceException
      Deprecated.
      Specified by:
      getSchemaVersion in interface TopiaMigrationService
      Throws:
      TopiaMigrationServiceException
    • initOnCreateSchema

      public void initOnCreateSchema()
      Deprecated.
      Specified by:
      initOnCreateSchema in interface TopiaMigrationService
    • 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 filter
      min - min version to accept
      max - max version to accept
      includeMin - flag to include min version
      includeMax - flag to include max version
      Returns:
      versions between min and max
    • runSchemaMigration

      public void runSchemaMigration()
      Deprecated.
      Specified by:
      runSchemaMigration in interface TopiaMigrationService
    • 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:
      true if there is no schema for any of the dealed entities, false otherwise.
      Since:
      2.5.3
    • getSafeParameter

      protected String getSafeParameter(Properties config, String key)
      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:
      close in interface TopiaService