|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.migration.TopiaMigrationEngine
public class TopiaMigrationEngine
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.
| Field Summary | |
|---|---|
protected AbstractTopiaMigrationCallback |
callback
CallbackHandler list (initialise en pre-init) |
protected TopiaContextListener |
contextListener
delegate context listener. |
protected boolean |
dbNotVersioned
Drapeau pour savoir si la base est versionnée ou non |
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 org.hibernate.cfg.Configuration |
legacyVersionConfiguration
Configuration hibernate ne mappant que l'entite version de l'ancien systeme de migration (initialise en pre-init) |
protected boolean |
legacyVersionTableExist
Un drapeau pour savoir si la table version (de l'ancien service Manual) existe en base (initialise en pre-init) |
protected boolean |
migrateOnInit
Un drapeau pour effectuer la migration au demarrage (initialise en pre-init) |
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 TopiaTransactionVetoable |
transactionVetoable
delgate transaction listener |
protected org.hibernate.cfg.Configuration |
versionConfiguration
Configuration hibernate ne mappant que l'entite version (initialise en pre-init) |
protected boolean |
versionDetected
A flag to check if version was detected in database. |
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 |
|---|
MIGRATION_CALLBACK, MIGRATION_MIGRATE_ON_INIT, MIGRATION_SHOW_PROGRESSION, MIGRATION_SHOW_SQL, SERVICE_NAME, TOPIA_SERVICE_NAME |
| Constructor Summary | |
|---|---|
TopiaMigrationEngine()
|
|
| Method Summary | |
|---|---|
protected void |
checkInit()
|
protected org.hibernate.cfg.Configuration |
creaHibernateConfiguration(org.hibernate.cfg.Configuration configuration)
|
protected void |
detectDbVersion()
Recupere depuis la base les états internes du service : versionTableExist dbVersion |
void |
doMigrateSchema()
|
Class<?>[] |
getPersistenceClasses()
|
protected String |
getSafeParameter(Properties config,
String key)
|
String |
getServiceName()
|
protected org.nuiton.util.Version |
getVersion(boolean versionTableExist,
String tableName)
|
boolean |
migrateSchema()
|
boolean |
postInit(TopiaContextImplementor context)
|
boolean |
preInit(TopiaContextImplementor context)
|
protected void |
saveApplicationVersion()
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 |
|---|
protected org.hibernate.cfg.Configuration versionConfiguration
protected boolean versionTableExist
protected org.hibernate.cfg.Configuration legacyVersionConfiguration
protected boolean legacyVersionTableExist
protected org.nuiton.util.Version dbVersion
protected boolean dbNotVersioned
protected boolean migrateOnInit
protected AbstractTopiaMigrationCallback callback
protected TopiaContextImplementor rootContext
protected boolean init
protected boolean versionDetected
true at the end of method detectDbVersion().
protected boolean showSql
protected boolean showProgression
protected final TopiaContextListener contextListener
protected final TopiaTransactionVetoable transactionVetoable
| Constructor Detail |
|---|
public TopiaMigrationEngine()
| 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 TopiaService
public void doMigrateSchema()
throws MigrationServiceException
MigrationServiceException
public boolean migrateSchema()
throws MigrationServiceException
migrateSchema in interface TopiaMigrationServiceMigrationServiceExceptionprotected void saveApplicationVersion()
protected void detectDbVersion()
protected org.nuiton.util.Version getVersion(boolean versionTableExist,
String tableName)
protected String getSafeParameter(Properties config,
String key)
protected void checkInit()
protected org.hibernate.cfg.Configuration creaHibernateConfiguration(org.hibernate.cfg.Configuration configuration)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||