public abstract class AbstractTopiaMigrationCallback extends Object
| Constructor and Description |
|---|
AbstractTopiaMigrationCallback() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
askUser(org.nuiton.util.version.Version dbVersion,
List<org.nuiton.util.version.Version> versions)
Hook to ask user if migration can be performed.
|
boolean |
doMigration(TopiaContext ctxt,
org.nuiton.util.version.Version dbVersion,
boolean showSql,
boolean showProgression,
List<org.nuiton.util.version.Version> versions)
Tentative de migration depuis la version de la base version la version
souhaitee.
|
void |
executeSQL(TopiaContextImplementor tx,
boolean showSql,
boolean showProgression,
String... sqls)
Executes the given
sqls requests. |
void |
executeSQL(TopiaContextImplementor tx,
String... sqls) |
abstract org.nuiton.util.version.Version |
getApplicationVersion() |
abstract org.nuiton.util.version.Version[] |
getAvailableVersions() |
protected abstract void |
migrateForVersion(org.nuiton.util.version.Version version,
TopiaContextImplementor tx,
boolean showSql,
boolean showProgression) |
void |
setTmsVersionPersister(TMSVersionPersister tmsVersionPersister) |
public abstract org.nuiton.util.version.Version[] getAvailableVersions()
public abstract org.nuiton.util.version.Version getApplicationVersion()
public abstract boolean askUser(org.nuiton.util.version.Version dbVersion,
List<org.nuiton.util.version.Version> versions)
dbVersion - the actual db versionversions - the versions to updatefalse if migration is canceled, true otherwise.protected abstract void migrateForVersion(org.nuiton.util.version.Version version,
TopiaContextImplementor tx,
boolean showSql,
boolean showProgression)
throws Exception
Exceptionpublic boolean doMigration(TopiaContext ctxt, org.nuiton.util.version.Version dbVersion, boolean showSql, boolean showProgression, List<org.nuiton.util.version.Version> versions) throws MigrationServiceException
version.
Pour chaque version, on cherche la methode migrateTo_XXX ou XXX est la
version transforme en identifiant java via la methode
Version.getValidName() et on l'execute.
Note: pour chaque version a appliquer, on ouvre une nouvelle transaction.ctxt - topia context de la transaction en coursdbVersion - database versionshowSql - drapeau pour afficher les requete sqlshowProgression - drapeau pour afficher la progressionversions - all versions knwon by service @return migration a
ggrementtrue si la migration est accepté, false autrement.MigrationServiceExceptionpublic void executeSQL(TopiaContextImplementor tx, String... sqls) throws TopiaException
TopiaExceptionpublic void executeSQL(TopiaContextImplementor tx, boolean showSql, boolean showProgression, String... sqls) throws TopiaException
sqls requests.tx - the sessionshowSql - flag to see sql requestsshowProgression - flag to see progession on consolesqls - requests to executeTopiaException - if any pbpublic void setTmsVersionPersister(TMSVersionPersister tmsVersionPersister)
Copyright © 2004–2018 CodeLutin. All rights reserved.