|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.migration.ManualMigrationEngine
public class ManualMigrationEngine
TopiaMigrationServiceImpl.java Classe principale du projet.
| Field Summary | |
|---|---|
protected org.nuiton.util.Version |
applicationVersion
Version courante de l'application (initialise en pre-init) |
protected ManualMigrationCallback |
callback
CallbackHandler list (initialise en pre-init) |
protected org.nuiton.util.Version |
dbVersion
Version courante de la base (initialise en pre-init) |
protected boolean |
init
Un drapeau pour savoir si le service a bien ete initialise (i.e a bien fini la methode preInit) |
protected String |
mappingsDirectory
Chemin du dossier contenant les schemas de toutes les versions (initialise en pre-init) |
protected boolean |
migrateOnInit
Un drapeau pour effectuer la migration au demarrage (initialise en pre-init) |
static String |
MIGRATION_APPLICATION_VERSION
La version de référence |
static String |
MIGRATION_CALLBACK
L'unique handler a utiliser |
static String |
MIGRATION_MAPPING_DIRECTORY
L'emplacement de tous les mappings |
static String |
MIGRATION_MIGRATE_ON_INIT
Un drapeau pour indiquer si on doit lancer le service au demarrage |
static String |
MIGRATION_MODEL_NAME
Les noms des modèles connus |
static String |
MIGRATION_SHOW_PROGRESSION
Pour afficher la progression des requetes sql executees |
static String |
MIGRATION_SHOW_SQL
Pour afficher les requetes sql executees |
protected TopiaContextImplementor |
rootContext
topia root context (initialise en pre-init) |
protected boolean |
showProgression
Un drapeau pour afficher la progression des requetes sql executees |
protected boolean |
showSql
Un drapeau pour afficher les requetes sql executees |
protected org.hibernate.cfg.Configuration |
versionConfiguration
Configuration hibernate ne mappant que l'entite version (initialise en pre-init) |
protected SortedSet<org.nuiton.util.Version> |
versions
ensemble des versions connues par le service |
protected boolean |
versionTableExist
Un drapeau pour savoir si la table version existe en base (initialise en pre-init) |
| Fields inherited from interface org.nuiton.topia.migration.TopiaMigrationService |
|---|
SERVICE_NAME |
| Constructor Summary | |
|---|---|
ManualMigrationEngine()
|
|
| Method Summary | |
|---|---|
void |
beginTransaction(TopiaTransactionEvent event)
|
protected void |
checkInit()
|
protected void |
detectDbVersion()
Recupere depuis la base les états internes du service : versionTableExist dbVersion |
void |
doMigrateSchema()
|
Class<?>[] |
getPersistenceClasses()
|
String |
getServiceName()
|
protected SortedSet<org.nuiton.util.Version> |
getVersions()
Recupere toutes les versions prises en charge par le service de migration. |
boolean |
migrateSchema()
|
void |
postCreateSchema(TopiaContextEvent event)
|
boolean |
postInit(TopiaContextImplementor context)
|
void |
postRestoreSchema(TopiaContextEvent event)
|
void |
postUpdateSchema(TopiaContextEvent event)
|
void |
preCreateSchema(TopiaContextEvent event)
|
boolean |
preInit(TopiaContextImplementor context)
|
void |
preRestoreSchema(TopiaContextEvent event)
|
void |
preUpdateSchema(TopiaContextEvent event)
|
void |
saveVersion(org.nuiton.util.Version version)
Enregistre la version donnee en base avec creation de la table si elle n'existe pas. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MIGRATION_APPLICATION_VERSION
public static final String MIGRATION_MAPPING_DIRECTORY
public static final String MIGRATION_MODEL_NAME
public static final String MIGRATION_CALLBACK
public static final String MIGRATION_MIGRATE_ON_INIT
public static final String MIGRATION_SHOW_SQL
public static final String MIGRATION_SHOW_PROGRESSION
protected org.hibernate.cfg.Configuration versionConfiguration
protected String mappingsDirectory
protected SortedSet<org.nuiton.util.Version> versions
protected org.nuiton.util.Version applicationVersion
protected boolean versionTableExist
protected org.nuiton.util.Version dbVersion
protected boolean migrateOnInit
protected ManualMigrationCallback callback
protected TopiaContextImplementor rootContext
protected boolean init
protected boolean showSql
protected boolean showProgression
| Constructor Detail |
|---|
public ManualMigrationEngine()
| Method Detail |
|---|
public Class<?>[] getPersistenceClasses()
getPersistenceClasses in interface TopiaServicepublic String getServiceName()
getServiceName in interface TopiaServicepublic boolean preInit(TopiaContextImplementor context)
preInit in interface TopiaServicepublic boolean postInit(TopiaContextImplementor context)
postInit in interface TopiaServicepublic void preCreateSchema(TopiaContextEvent event)
preCreateSchema in interface TopiaContextListenerpublic void preRestoreSchema(TopiaContextEvent event)
preRestoreSchema in interface TopiaContextListenerpublic void preUpdateSchema(TopiaContextEvent event)
preUpdateSchema in interface TopiaContextListenerpublic void postCreateSchema(TopiaContextEvent event)
postCreateSchema in interface TopiaContextListenerpublic void postUpdateSchema(TopiaContextEvent event)
postUpdateSchema in interface TopiaContextListenerpublic void postRestoreSchema(TopiaContextEvent event)
postRestoreSchema in interface TopiaContextListenerpublic void beginTransaction(TopiaTransactionEvent event)
beginTransaction in interface TopiaTransactionVetoable
public void doMigrateSchema()
throws MigrationServiceException
MigrationServiceException
public boolean migrateSchema()
throws MigrationServiceException
migrateSchema in interface TopiaMigrationServiceMigrationServiceExceptionpublic void saveVersion(org.nuiton.util.Version version)
version - la nouvelle version de la base
protected SortedSet<org.nuiton.util.Version> getVersions()
throws MigrationServiceException
MigrationServiceException - pour tout problemeprotected void detectDbVersion()
protected void checkInit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||