r2009 - in trunk/topia-service-migration: . src/main/java/org/nuiton/topia/migration src/main/java/org/nuiton/topia/migration/mappings src/main/resources/org/nuiton/topia/migration src/main/resources/org/nuiton/topia/migration/mappings
Author: tchemit Date: 2010-06-13 19:48:26 +0200 (Sun, 13 Jun 2010) New Revision: 2009 Url: http://nuiton.org/repositories/revision/topia/2009 Log: finalize migration of migration service (no more generation (all stuff was pushed back to source and will disappear soon) Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceDAOHelper.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersion.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionAbstract.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAO.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOAbstract.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOImpl.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionImpl.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/TMSVersionImpl.hbm.xml Modified: trunk/topia-service-migration/pom.xml trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersion.java trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml Modified: trunk/topia-service-migration/pom.xml =================================================================== --- trunk/topia-service-migration/pom.xml 2010-06-13 17:30:39 UTC (rev 2008) +++ trunk/topia-service-migration/pom.xml 2010-06-13 17:48:26 UTC (rev 2009) @@ -102,12 +102,12 @@ <resources> - <resource> + <!--resource> <directory>${maven.gen.dir}/java</directory> <includes> <include>**/*.hbm.xml</include> </includes> - </resource> + </resource--> <resource> <directory>${maven.src.dir}/main/resources</directory> @@ -121,7 +121,7 @@ <plugins> - <plugin> + <!--plugin> <groupId>org.nuiton.eugene</groupId> <artifactId>maven-eugene-plugin</artifactId> <executions> @@ -146,7 +146,7 @@ <scope>compile</scope> </dependency> </dependencies> - </plugin> + </plugin--> <plugin> <groupId>org.nuiton.i18n</groupId> Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceDAOHelper.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceDAOHelper.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceDAOHelper.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,267 @@ +package org.nuiton.topia.migration; + +import java.lang.reflect.Array; +import java.util.Arrays; +import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; +import org.nuiton.topia.persistence.TopiaDAO; +import org.nuiton.topia.persistence.TopiaEntity; +import org.nuiton.topia.persistence.TopiaEntityEnum; + +@Deprecated +public class MigrationServiceDAOHelper { + + + + public enum MigrationServiceEntityEnum implements TopiaEntityEnum { + + TMSVersion(TMSVersion.class); + /** + * the contract of the entity + */ + protected Class<? extends TopiaEntity> contract; + /** + * the fully qualified name of the implementation of the entity + */ + protected String implementationFQN; + /** + * the implementation class of the entity (will be lazy computed at runtime) + */ + protected Class<? extends TopiaEntity> implementation; + /** + * MigrationServiceEntityEnum : + * @param contract + */ + + MigrationServiceEntityEnum(Class<? extends TopiaEntity > contract) { + this.contract = contract; + this.implementationFQN = contract.getName()+"Impl"; + } + + /** + * getContract : + * @return Class<? extends TopiaEntity> + */ + + public Class<? extends TopiaEntity> getContract() { + return contract; + } + + /** + * getImplementationFQN : + * @return String + */ + + public String getImplementationFQN() { + return implementationFQN; + } + + /** + * setImplementationFQN : + * @param implementationFQN + */ + + public void setImplementationFQN(String implementationFQN) { + this.implementationFQN = implementationFQN; + this.implementation = null; + } + + /** + * accept : + * @param klass + * @return boolean + */ + + public boolean accept(Class<? extends TopiaEntity> klass) { + return MigrationServiceDAOHelper.getContractClass(klass) == contract; + } + + /** + * getImplementation : + * @return Class<? extends TopiaEntity> + */ + + public Class<? extends TopiaEntity> getImplementation() { + if (implementation == null) { + try { + implementation = (Class<? extends TopiaEntity>) Class.forName(implementationFQN); + } catch (ClassNotFoundException e) { + throw new RuntimeException("could not find class " + implementationFQN); + } + } + return implementation; + } + + /** + * valueOf : + * @param entity + * @return MigrationServiceEntityEnum + */ + + public static MigrationServiceEntityEnum valueOf(TopiaEntity entity) { + return valueOf(entity.getClass()); + } + + /** + * valueOf : + * @param klass + * @return MigrationServiceEntityEnum + */ + + public static MigrationServiceEntityEnum valueOf(Class<?> klass) { + if (klass.isInterface()) { + return MigrationServiceEntityEnum.valueOf(klass.getSimpleName()); + } + for (MigrationServiceEntityEnum entityEnum : MigrationServiceEntityEnum.values()) { + if (entityEnum.getContract().isAssignableFrom(klass)) { + //todo check it works for inheritance + return entityEnum; + } + } + throw new IllegalArgumentException("no entity defined for the class " + klass + " in : " + Arrays.toString(MigrationServiceEntityEnum.values())); + } + + + } //MigrationServiceEntityEnum + /** + * MigrationServiceDAOHelper : + */ + + protected MigrationServiceDAOHelper() { } + + /** + * getModelVersion : + * @return String + */ + + public static String getModelVersion() { + return "1"; + } + + /** + * getModelName : + * @return String + */ + + public static String getModelName() { + return "MigrationService"; + } + + /** + * getTMSVersionDAO : + * @param context + * @return TMSVersionDAO + * @throws TopiaException + */ + + public static TMSVersionDAO getTMSVersionDAO(TopiaContext context) throws TopiaException { + TopiaContextImplementor ci = (TopiaContextImplementor) context; + TMSVersionDAO result = (TMSVersionDAO) ci.getDAO(TMSVersion.class); + return result; + } + + /** + * getDAO : + * @param context + * @param klass + * @return <T extends TopiaEntity, D extends TopiaDAO<? super T>> D + * @throws TopiaException + */ + + public static <T extends TopiaEntity, D extends TopiaDAO<? super T>> D getDAO(TopiaContext context, Class<T> klass) throws TopiaException { + TopiaContextImplementor ci = (TopiaContextImplementor) context; + MigrationServiceEntityEnum constant = MigrationServiceEntityEnum.valueOf(klass); + D dao = (D) ci.getDAO(constant.getContract()); + return dao; + } + + /** + * getDAO : + * @param context + * @param entity + * @return <T extends TopiaEntity, D extends TopiaDAO<? super T>> D + * @throws TopiaException + */ + + public static <T extends TopiaEntity, D extends TopiaDAO<? super T>> D getDAO(TopiaContext context, T entity) throws TopiaException { + TopiaContextImplementor ci = (TopiaContextImplementor) context; + MigrationServiceEntityEnum constant = MigrationServiceEntityEnum.valueOf(entity); + D dao = (D) ci.getDAO(constant.getContract()); + return dao; + } + + /** + * getContractClass : + * @param klass + * @return <T extends TopiaEntity> Class<T> + */ + + public static <T extends TopiaEntity> Class<T> getContractClass(Class<T> klass) { + MigrationServiceEntityEnum constant = MigrationServiceEntityEnum.valueOf(klass); + return (Class<T>) constant.getContract(); + } + + /** + * getImplementationClass : + * @param klass + * @return <T extends TopiaEntity> Class<T> + */ + + public static <T extends TopiaEntity> Class<T> getImplementationClass(Class<T> klass) { + MigrationServiceEntityEnum constant = MigrationServiceEntityEnum.valueOf(klass); + return (Class<T>) constant.getImplementation(); + } + + /** + * getContractClasses : + * @return Class<? extends TopiaEntity>[] + */ + + public static Class<? extends TopiaEntity>[] getContractClasses() { + MigrationServiceEntityEnum[] values = MigrationServiceEntityEnum.values(); + Class<? extends TopiaEntity>[] result = (Class<? extends TopiaEntity>[]) Array.newInstance(Class.class, values.length); + for (int i = 0; i < values.length; i++) { + result[i] = values[i].getContract(); + } + return result; + } + + /** + * getImplementationClasses : + * @return Class<? extends TopiaEntity>[] + */ + + public static Class<? extends TopiaEntity>[] getImplementationClasses() { + MigrationServiceEntityEnum[] values = MigrationServiceEntityEnum.values(); + Class<? extends TopiaEntity>[] result = (Class<? extends TopiaEntity>[]) Array.newInstance(Class.class, values.length); + for (int i = 0; i < values.length; i++) { + result[i] = values[i].getImplementation(); + } + return result; + } + + /** + * getImplementationClassesAsString : + * @return String + */ + + public static String getImplementationClassesAsString() { + StringBuilder buffer = new StringBuilder(); + for (Class<? extends TopiaEntity> aClass : getImplementationClasses()) { + buffer.append(',').append(aClass.getName()); + } + return buffer.substring(1); + } + + /** + * getContracts : + * @return MigrationServiceEntityEnum[] + */ + + public static MigrationServiceEntityEnum[] getContracts() { + return MigrationServiceEntityEnum.values(); + } + + + } //MigrationServiceDAOHelper Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/MigrationServiceDAOHelper.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersion.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersion.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersion.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,22 @@ +package org.nuiton.topia.migration; + +import org.nuiton.topia.persistence.TopiaEntity; + +@Deprecated +public interface TMSVersion extends TopiaEntity { String VERSION = "version"; + /** + * setVersion : + * @param version La valeur de l'attribut version à positionner. + */ + + void setVersion(String version); + + /** + * getVersion : + * @return String + */ + + String getVersion(); + + +} //TMSVersion Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersion.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionAbstract.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionAbstract.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionAbstract.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,143 @@ +package org.nuiton.topia.migration; + +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; +import org.nuiton.topia.persistence.EntityVisitor; +import org.nuiton.topia.persistence.TopiaEntity; +import org.nuiton.topia.persistence.TopiaEntityAbstract; + +@Deprecated +public abstract class TMSVersionAbstract extends TopiaEntityAbstract implements TMSVersion { + + protected String version; + /** + * getVersion : + * @return String + */ + + public String getVersion() { + fireOnPreRead(VERSION, version); + java.lang.String result = this.version; + fireOnPostRead(VERSION, version); + return result; +} + + /** + * update : + * @deprecated since 2.4, use the DAO api instead. + * @throws TopiaException + */ + + @Deprecated + @Override + public void update() throws TopiaException { + ((TopiaContextImplementor)getTopiaContext()).getDAO(TMSVersion.class).update(this); +} + + /** + * delete : + * @deprecated since 2.4, use the DAO api instead. + * @throws TopiaException + */ + + @Deprecated + @Override + public void delete() throws TopiaException { + ((TopiaContextImplementor)getTopiaContext()).getDAO(TMSVersion.class).delete(this); +} + + /** + * accept : + * Envoi via les methodes du visitor l'ensemble des champs de l'entity +avec leur nom, type et valeur. + * @param visitor le visiteur de l'entite. + * @throws TopiaException + */ + + @Override + public void accept(EntityVisitor visitor) throws TopiaException { + visitor.start(this); + visitor.visit(this, VERSION, String.class, version); + visitor.end(this); +} + + /** + * getAggregate : + * @return List<TopiaEntity> + * @throws TopiaException + */ + + @Override + public List<TopiaEntity> getAggregate() throws TopiaException { + List<TopiaEntity> tmp = new ArrayList<TopiaEntity>(); + + // pour tous les attributs rechecher les composites et les class d'asso + // on les ajoute dans tmp + + // on refait un tour sur chaque entity de tmp pour recuperer leur + // composite + List<TopiaEntity> result = new ArrayList<TopiaEntity>(); + for (TopiaEntity entity : tmp) { + result.add(entity); + result.addAll(entity.getAggregate()); + } + + return result; +} + + /** + * getComposite : + * @return List<TopiaEntity> + * @throws TopiaException + */ + + @Override + public List<TopiaEntity> getComposite() throws TopiaException { + List<TopiaEntity> tmp = new ArrayList<TopiaEntity>(); + + // pour tous les attributs rechecher les composites et les class d'asso + // on les ajoute dans tmp + + // on refait un tour sur chaque entity de tmp pour recuperer leur + // composite + List<TopiaEntity> result = new ArrayList<TopiaEntity>(); + for (TopiaEntity entity : tmp) { + if (entity != null) { + result.add(entity); + result.addAll(entity.getComposite()); + } + } + + return result; + } + + /** + * setVersion : + * @param value + */ + + public void setVersion(String value) { + String _oldValue = this.version; + fireOnPreWrite(VERSION, _oldValue, value); + this.version = value; + fireOnPostWrite(VERSION, _oldValue, value); +} + + /** + * toString : + * @return String + */ + + @Override + public String toString() { + String result = new ToStringBuilder(this). + append(VERSION, this.version). + toString(); + return result; +} + + +} //TMSVersionAbstract Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionAbstract.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAO.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAO.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAO.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,8 @@ +package org.nuiton.topia.migration; + + +@Deprecated +public class TMSVersionDAO extends TMSVersionDAOImpl<TMSVersion> { + + +} //TMSVersionDAO Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAO.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOAbstract.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOAbstract.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOAbstract.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,88 @@ +package org.nuiton.topia.migration; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; +import org.nuiton.topia.persistence.TopiaDAO; +import org.nuiton.topia.persistence.TopiaDAOImpl; +import org.nuiton.topia.persistence.TopiaEntity; + +@Deprecated +public abstract class TMSVersionDAOAbstract<E extends TMSVersion> extends TopiaDAOImpl<E> implements TopiaDAO<E> { + + /** + * getEntityClass : + * @return Class<E> + */ + + public Class<E> getEntityClass() { + return (Class<E>)TMSVersion.class; + } + + /** + * delete : + * @param entity + * @throws TopiaException + */ + + public void delete(E entity) throws TopiaException { + super.delete(entity); + } + + /** + * findByVersion : + * Retourne le premier élément trouvé ayant comme valeur pour l'attribut version le paramètre. + * @param v + * @return E + * @throws TopiaException + */ + + public E findByVersion(String v) throws TopiaException { + E result = findByProperty(TMSVersion.VERSION, v); + return result; + } + + /** + * findAllByVersion : + * Retourne les éléments ayant comme valeur pour l'attribut version le paramètre. + * @param v + * @return List<E> + * @throws TopiaException + */ + + public List<E> findAllByVersion(String v) throws TopiaException { + List<E> result = findAllByProperty(TMSVersion.VERSION, v); + return result; + } + + /** + * findUsages : + * @param type + * @param entity + * @return <U extends TopiaEntity> List<U> + * @throws TopiaException + */ + + @Override + public <U extends TopiaEntity> List<U> findUsages(Class<U> type, E entity) throws TopiaException { + return new ArrayList<U>(); + } + + /** + * findAllUsages : + * @param entity + * @return Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> + * @throws TopiaException + */ + + @Override + public Map<Class<? extends TopiaEntity>, List<? extends TopiaEntity>> findAllUsages(E entity) throws TopiaException { + return new HashMap<Class<? extends TopiaEntity>, List<? extends TopiaEntity>>(); + } + + +} //TMSVersionDAOAbstract<E extends TMSVersion> Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOAbstract.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOImpl.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOImpl.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOImpl.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,8 @@ +package org.nuiton.topia.migration; + + +@Deprecated +public class TMSVersionDAOImpl<E extends TMSVersion> extends TMSVersionDAOAbstract<E> { + + +} //TMSVersionDAOImpl<E extends TMSVersion> Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionDAOImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionImpl.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionImpl.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionImpl.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,8 @@ +package org.nuiton.topia.migration; + + +@Deprecated +public class TMSVersionImpl extends TMSVersionAbstract { + + +} //TMSVersionImpl Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TMSVersionImpl.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2010-06-13 17:30:39 UTC (rev 2008) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationEngine.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -29,16 +29,18 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.cfg.Configuration; -import org.hibernate.tool.hbm2ddl.SchemaExport; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; import org.nuiton.topia.TopiaRuntimeException; +import org.nuiton.topia.event.TopiaContextAdapter; import org.nuiton.topia.event.TopiaContextEvent; import org.nuiton.topia.event.TopiaContextListener; import org.nuiton.topia.event.TopiaTransactionEvent; import org.nuiton.topia.event.TopiaTransactionVetoable; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.framework.TopiaUtil; +import org.nuiton.topia.migration.mappings.TMSVersion; +import org.nuiton.topia.migration.mappings.TMSVersionDAO; import org.nuiton.util.Version; import org.nuiton.util.VersionUtil; import org.nuiton.util.VersionUtil.VersionComparator; @@ -74,6 +76,12 @@ /** Un drapeau pour savoir si la table version existe en base (initialise en pre-init) */ protected boolean versionTableExist; + /** Configuration hibernate ne mappant que l'entite version de l'ancien systeme de migration (initialise en pre-init) */ + protected Configuration legacyVersionConfiguration; + + /** Un drapeau pour savoir si la table version (de l'ancien service Manual) existe en base (initialise en pre-init) */ + protected boolean legacyVersionTableExist; + /** Version courante de la base (initialise en pre-init) */ protected Version dbVersion; @@ -92,6 +100,13 @@ /** Un drapeau pour savoir si le service a bien ete initialise (i.e a bien fini la methode preInit) */ protected boolean init; + /** + * A flag to check if version was detected in database. + * <p/> + * This flag is set to {@code true} at the end of method {@link #detectDbVersion()}. + */ + protected boolean versionDetected; + /** Un drapeau pour afficher les requetes sql executees */ protected boolean showSql; @@ -99,18 +114,66 @@ protected boolean showProgression; /** delegate context listener. */ - protected TopiaContextListener contextListener; + protected final TopiaContextListener contextListener; /** delgate transaction listener */ - protected TopiaTransactionVetoable transactionVetoable; + protected final TopiaTransactionVetoable transactionVetoable; + public TopiaMigrationEngine() { + + transactionVetoable = new TopiaTransactionVetoable() { + @Override + public void beginTransaction(TopiaTransactionEvent event) { + + TopiaContextImplementor context = + (TopiaContextImplementor) event.getSource(); + + // add topia context listener + context.addTopiaContextListener(contextListener); + + } + }; + contextListener = new TopiaContextAdapter() { + + @Override + public void postCreateSchema(TopiaContextEvent event) { + if (log.isDebugEnabled()) { + log.debug("postCreateSchema event called : will save version in database"); + } + saveApplicationVersion(); + } + + @Override + public void postUpdateSchema(TopiaContextEvent event) { + if (log.isDebugEnabled()) { + log.debug("postUpdateSchema event called : will save version in database"); + } + saveApplicationVersion(); + } + + @Override + public void postRestoreSchema(TopiaContextEvent event) { + if (log.isDebugEnabled()) { + log.debug("postRestoreSchema event detected, redo, schema migration"); + } + try { + doMigrateSchema(); + } catch (Exception e) { + if (log.isErrorEnabled()) { + log.error("postRestoreSchema schema migration failed for reason " + e.getMessage(), e); + } + } + } + }; + } + //-------------------------------------------------------------------------- //-- TopiaService implementation //-------------------------------------------------------------------------- @Override public Class<?>[] getPersistenceClasses() { - return new Class<?>[]{TMSVersionImpl.class}; + return new Class<?>[]{TMSVersion.class}; } @Override @@ -154,27 +217,21 @@ // creation de la configuration hibernate ne concernant que l'entite Version // afin de pouvoir creer la table via un schemaExport si necessaire - versionConfiguration = new Configuration(); + Configuration configuration = new Configuration(); + configuration.addXML(TMSVersionDAO.MAPPING); - for (Class<?> clazz : getPersistenceClasses()) { - if (log.isDebugEnabled()) { - log.debug("addClass " + clazz); - } - versionConfiguration.addClass(clazz); - } + versionConfiguration = creaHibernateConfiguration(configuration); - Properties prop = new Properties(); - prop.putAll(versionConfiguration.getProperties()); - prop.putAll(config); - - versionConfiguration.setProperties(prop); - init = true; // add topia context listener - context.addTopiaContextListener(getContextListener()); - context.addTopiaTransactionVetoable(getTransactionVetoable()); + context.addTopiaContextListener(contextListener); + context.addTopiaTransactionVetoable(transactionVetoable); + if (log.isDebugEnabled()) { + log.debug("Service [" + this + "] is init."); + } + if (migrateOnInit) { try { @@ -188,15 +245,15 @@ } } else { if (log.isDebugEnabled()) { - log.debug("migration service, skip migration on init"); + log.debug("Service [" + this + "] skip migration on init as required"); } } - return true; } @Override public boolean postInit(TopiaContextImplementor context) { + // nothing to do in post-init return true; } @@ -211,35 +268,38 @@ } } + //-------------------------------------------------------------------------- + //-- TopiaMigrationService implementation + //-------------------------------------------------------------------------- + @Override public boolean migrateSchema() throws MigrationServiceException { checkInit(); - if (dbVersion == null || !migrateOnInit) { + detectDbVersion(); - // no db version was setted or service was not init on int - // force detection of version to be safe - if (log.isDebugEnabled()) { - log.debug("Will detects db version..."); - } - detectDbVersion(); - } +// if (dbVersion == null || !migrateOnInit) { +// +// // no db version was setted or service was not init on int +// // force detection of version to be safe +// if (log.isDebugEnabled()) { +// log.debug("Will detects db version..."); +// } +// detectDbVersion(); +// } - Version applicationVersion = callback.getApplicationVersion(); + Version version = callback.getApplicationVersion(); - log.info(_("topia.migration.start.migration", applicationVersion.getVersion(), dbVersion.getVersion())); + log.info(_("topia.migration.start.migration", version.getVersion(), dbVersion.getVersion())); - // tell if migration is needed - boolean bMigrationNeeded = false; - if (log.isDebugEnabled()) { - log.debug("Migrate schema start version = " + dbVersion + - " _ not versioned = " + dbNotVersioned + - " _ TMSVersion exists = " + versionTableExist); + log.debug("Migrate schema to version = " + dbVersion); + log.debug("is db not versionned ? = " + dbNotVersioned); + log.debug("TMSVersion exists = " + versionTableExist); } - if (versionTableExist && dbVersion.equals(applicationVersion)) { + if (versionTableExist && dbVersion.equals(version)) { log.info(_("topia.migration.skip.migration.db.is.up.to.date")); // la base est a jour return true; @@ -254,18 +314,31 @@ return true; } + if (legacyVersionTableExist && dbVersion.equals(version)) { + + // on a trouvee une table depreciee tmsVersion avec la bonne version de base + // il suffit donc d'enregister la version dans la nouvelle table + log.info(_("topia.migration.skip.migration.db.is.up.to.date")); + // la base est a jour mais il faut migrer la table + saveApplicationVersion(); + return true; + } + SortedSet<Version> allVersions = new TreeSet<Version>(new VersionComparator()); allVersions.addAll(Arrays.asList(callback.getAvailableVersions())); log.info(_("topia.migration.available.versions", allVersions)); - if (dbVersion.before(applicationVersion)) { + // tell if migration is needed + boolean needToMigrate = false; + if (dbVersion.before(version)) { + // on filtre les versions a appliquer List<Version> versionsToApply = VersionUtil.filterVersions(allVersions, dbVersion, - applicationVersion, + version, false, true ); @@ -275,16 +348,16 @@ } else { log.info(_("topia.migration.migrate.versions", versionsToApply)); // ask handler for migration - bMigrationNeeded = callback.doMigration(rootContext, - dbVersion, - showSql, - showProgression, - versionsToApply); + needToMigrate = callback.doMigration(rootContext, + dbVersion, + showSql, + showProgression, + versionsToApply); if (log.isDebugEnabled()) { - log.debug("Handler choose : " + bMigrationNeeded); + log.debug("Handler choose : " + needToMigrate); } - if (!bMigrationNeeded) { + if (!needToMigrate) { // l'utilisateur a annule la migration return false; } @@ -292,10 +365,10 @@ } // on sauvegarde la version si necessaire (base non versionnee ou migration realisee) - if (!versionTableExist || bMigrationNeeded) { + if (!versionTableExist || needToMigrate) { if (log.isDebugEnabled()) { - log.debug("Set application version in database to " + applicationVersion); + log.debug("Set application version in database to " + version); } // put version in database and create table if required @@ -308,25 +381,28 @@ return true; } + //-------------------------------------------------------------------------- + //-- Internal methods + //-------------------------------------------------------------------------- + /** * Enregistre la version donnee en base avec creation de la table * si elle n'existe pas. */ - public void saveApplicationVersion() { + protected void saveApplicationVersion() { checkInit(); Version version = callback.getApplicationVersion(); + detectDbVersion(); + if (log.isDebugEnabled()) { - log.debug("Save version = " + version + - " _ table exists = " + versionTableExist); + log.debug("Save version = " + version); + log.debug("table exists = " + versionTableExist); + log.debug("Detected version = " + dbVersion); } - if (dbVersion == null) { - detectDbVersion(); - } - try { boolean createTable = !versionTableExist; @@ -336,36 +412,34 @@ // si la base n'etait pas versionnee, la table version n'existe pas // creation if (log.isDebugEnabled()) { - log.debug("Adding table to put version"); + log.debug("Adding tms_version table"); } // creer le schema en base // dans la configuration versionConfiguration, il n'y a que la table version - SchemaExport schemaExport = new SchemaExport(versionConfiguration); - schemaExport.create(log.isDebugEnabled(), true); + TMSVersionDAO.createTable(versionConfiguration); if (log.isDebugEnabled()) { log.debug("Table for " + TMSVersion.class.getSimpleName() + " created"); } + } - } - // Changement de la version en base + // Set new version in database TopiaContext tx = rootContext.beginTransaction(); try { - TMSVersionDAO dao = MigrationServiceDAOHelper.getTMSVersionDAO(tx); + // delete all previous data in table + TMSVersionDAO.deleteAll(tx); - //FIXME on supprime toues les versions precedentes ??? - //FIXME il serait mieux de conserver toutes les versions je pense... - //FIXME on pourrait conserver l'information sur les date de mise a jour - List<TMSVersion> toDelete = dao.findAll(); - for (TMSVersion v : toDelete) { - dao.delete(v); + log.info(_("topia.migration.saving.db.version", version)); + + // create new version and store it in table + TMSVersion tmsVersion = + TMSVersionDAO.create(tx, version.getVersion()); + if (log.isDebugEnabled()) { + log.debug("Created version : " + tmsVersion.getVersion()); } - log.info(_("topia.migration.saving.db.version", version)); - dao.create(TMSVersion.VERSION, version.getVersion()); - tx.commitTransaction(); } catch (TopiaException e) { if (tx != null) { @@ -377,6 +451,15 @@ tx.closeContext(); } } + + if (legacyVersionTableExist) { + + if (log.isDebugEnabled()) { + log.debug("Will drop legacy tmsVersion table"); + } + // on supprime l'ancienne table + TMSVersionDAO.dropTable(legacyVersionConfiguration); + } } catch (TopiaException e) { throw new TopiaRuntimeException(e); } @@ -388,128 +471,106 @@ dbVersion = version; } + /** + * Recupere depuis la base les états internes du service : + * <p/> + * <ul> + * <li>versionTableExist</li> + * <li>dbVersion</li> + * </ul> + */ + protected void detectDbVersion() { - protected TopiaContextListener getContextListener() { - if (contextListener == null) { - contextListener = new TopiaContextListener() { - @Override - public void preCreateSchema(TopiaContextEvent event) { - } + if (versionDetected) { - @Override - public void postCreateSchema(TopiaContextEvent event) { - if (log.isDebugEnabled()) { - log.debug("postCreateSchema event called : will save version in database"); - } + // this method was already invoked + if (log.isDebugEnabled()) { + log.debug("version was already detected : " + dbVersion); + } + return; + } - saveApplicationVersion(); - } + Version v = null; + try { - @Override - public void preUpdateSchema(TopiaContextEvent event) { + // on detecte si la table de versionning existe + versionTableExist = + TopiaUtil.isSchemaExist(versionConfiguration, + TMSVersion.class.getName()); - } + if (log.isDebugEnabled()) { + log.debug("Table " + TMSVersionDAO.TABLE_NAME + " exist = " + versionTableExist); + } - @Override - public void postUpdateSchema(TopiaContextEvent event) { - if (log.isDebugEnabled()) { - log.debug("postUpdateSchema event called : will save version in database"); - } + if (versionTableExist) { - saveApplicationVersion(); - } + // recuperation de la version de la base + v = getVersion(versionTableExist, TMSVersionDAO.TABLE_NAME); + return; + } - @Override - public void preRestoreSchema(TopiaContextEvent event) { - } + // try with legacy table tmsVersion + Configuration conf = new Configuration(); + conf.addXML(TMSVersionDAO.LEGACY_MAPPING); - @Override - public void postRestoreSchema(TopiaContextEvent event) { - if (log.isDebugEnabled()) { - log.debug("postRestoreSchema event detected, redo, schema migration"); - } - try { + legacyVersionConfiguration = creaHibernateConfiguration(conf); + legacyVersionTableExist = + TopiaUtil.isSchemaExist(legacyVersionConfiguration, + TMSVersion.class.getName()); - doMigrateSchema(); + if (legacyVersionTableExist) { - } catch (Exception e) { - if (log.isErrorEnabled()) { - log.error("postRestoreSchema schema migration failed for reason " + e.getMessage(), e); - } - } + if (log.isDebugEnabled()) { + log.debug("Legacy : detected " + TMSVersionDAO.LEGACY_TABLE_NAME + " table"); } - }; - } - return contextListener; - } - protected TopiaTransactionVetoable getTransactionVetoable() { - if (transactionVetoable == null) { - transactionVetoable = new TopiaTransactionVetoable() { - @Override - public void beginTransaction(TopiaTransactionEvent event) { + // recuperation de la version de la base + v = getVersion(legacyVersionTableExist, TMSVersionDAO.LEGACY_TABLE_NAME); - TopiaContextImplementor context = (TopiaContextImplementor) event.getSource(); + if (v != null) { - // add topia context listener - context.addTopiaContextListener(contextListener); + if (log.isDebugEnabled()) { + log.debug("Legacy : " + _("topia.migration.detected.db.version", v)); + } + } + } + } finally { - } - }; + if (v == null) { + // la base dans ce cas n'est pas versionee. + // On dit que la version de la base est 0 + // et les schema de cette version 0 doivent + // etre detenu en local + v = Version.VZERO; + dbNotVersioned = true; + log.info(_("topia.migration.db.not.versionned")); + } else { + log.info(_("topia.migration.detected.db.version", v)); + } + dbVersion = v; + versionDetected = true; } - return transactionVetoable; } - /** - * Recupere depuis la base les états internes du service : - * <p/> - * <ul> - * <li>versionTableExist</li> - * <li>dbVersion</li> - * </ul> - */ - protected void detectDbVersion() { + protected Version getVersion(boolean versionTableExist, String tableName) { + if (!versionTableExist) { - // on detecte si la table de versionning existe - versionTableExist = TopiaUtil.isSchemaExist(versionConfiguration, TMSVersionImpl.class.getName()); - - if (log.isDebugEnabled()) { - log.debug("Table TMSVersion exist = " + versionTableExist); + // table does not exist, version is null + return null; } - // recuperation de la version de la base - Version v = null; try { - if (versionTableExist) { - TopiaContext tx = null; - try { - tx = rootContext.beginTransaction(); - TMSVersionDAO dao = MigrationServiceDAOHelper.getTMSVersionDAO(tx); - List<TMSVersion> versionsInDB = dao.findAll(); - if (!versionsInDB.isEmpty()) { - v = VersionUtil.valueOf(versionsInDB.get(0).getVersion()); - } - } finally { - if (tx != null) { - tx.closeContext(); - } + TopiaContext tx = rootContext.beginTransaction(); + try { + Version v = TMSVersionDAO.getVersion(tx, tableName); + return v; + } finally { + if (tx != null) { + tx.closeContext(); } } } catch (TopiaException e) { throw new TopiaRuntimeException("Can't obtain dbVersion for reason " + e.getMessage(), e); } - - if (v == null) { - // la base dans ce cas n'est pas versionee. - // On dit que la version de la base est 0 - // et les schema de cette version 0 doivent - // etre detenu en local - v = Version.VZERO; - dbNotVersioned = true; - log.info(_("topia.migration.db.not.versionned")); - } else { - log.info(_("topia.migration.detected.db.version", v)); - } - dbVersion = v; } protected String getSafeParameter(Properties config, String key) { @@ -525,4 +586,18 @@ throw new IllegalStateException("le service n'est pas initialisé!"); } } + + protected Configuration creaHibernateConfiguration(Configuration configuration) { + Properties config = rootContext.getConfig(); + + Properties prop = new Properties(); + prop.putAll(configuration.getProperties()); + prop.putAll(config); + + configuration.setProperties(prop); + return configuration; + + } + + } \ No newline at end of file Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java 2010-06-13 17:30:39 UTC (rev 2008) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/TopiaMigrationService.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -37,7 +37,7 @@ * @author tchemit <chemit@codelutin.com> * @version $Id$ */ -public interface TopiaMigrationService extends TopiaService{ //}, TopiaContextListener, TopiaTransactionVetoable { +public interface TopiaMigrationService extends TopiaService { /** Nom du service */ String SERVICE_NAME = "migration"; Modified: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersion.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersion.java 2010-06-13 17:30:39 UTC (rev 2008) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersion.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -25,8 +25,12 @@ package org.nuiton.topia.migration.mappings; -import org.nuiton.topia.migration.TopiaMigrationEngine; +import org.apache.commons.lang.StringUtils; +import org.nuiton.util.Version; +import org.nuiton.util.VersionUtil; +import java.io.Serializable; + /** * TMSVersion.java * @@ -34,46 +38,45 @@ * @author Chevallereau Benjamin * @author Eon Sébastien * @author Trève Vincent - * @deprecated since 2.4, please use now the simplify service {@link TopiaMigrationEngine} + * @author tchemit <chemit@codelutin.com> + * @since 1.0 */ -@Deprecated -public class TMSVersion { +public class TMSVersion implements Serializable { - /** - * La version. - * - * String (gere les cas 1.0.2 par exemple) - */ + private static final long serialVersionUID = 1L; + + public static final String PROPERTY_VERSION = "version"; + + public static TMSVersion valueOf(Version version) { + return new TMSVersion(version.toString()); + } + + public static TMSVersion valueOf(String version) { + return new TMSVersion(version); + } + + /** La version. */ private String version; - /** - * Constructeur - */ - private TMSVersion() { + public TMSVersion() { } - /** - * Constructeur - * @param version la version - */ public TMSVersion(String version) { - this(); + if (StringUtils.isEmpty(version)) { + throw new IllegalArgumentException("version parameter can not be null nor empty."); + } this.version = version; } - /** - * Retourne la version - * @return la version - */ public String getVersion() { return version; } - /** - * Change la version - * @param version - */ public void setVersion(String version) { this.version = version; } + + public Version toVersion() { + return StringUtils.isEmpty(version) ? null : VersionUtil.valueOf(version); + } } Added: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java =================================================================== --- trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java (rev 0) +++ trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,161 @@ +package org.nuiton.topia.migration.mappings; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hibernate.Criteria; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.cfg.Configuration; +import org.hibernate.jdbc.Work; +import org.hibernate.tool.hbm2ddl.SchemaExport; +import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.TopiaRuntimeException; +import org.nuiton.topia.framework.TopiaContextImplementor; +import org.nuiton.util.Version; +import org.nuiton.util.VersionUtil; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +/** + * TMSVersion DAO helper. + * + * @author tchemit <chemit@codelutin.com> + * @since 2.4 + */ +public class TMSVersionDAO { + + /** logger */ + private final static Log log = LogFactory.getLog(TMSVersionDAO.class); + + public static final String LEGACY_TABLE_NAME = "tmsVersion"; + + public static final String TABLE_NAME = "tms_version"; + + public static TMSVersion get(TopiaContext tx) throws TopiaException { + + try { + Session session = ((TopiaContextImplementor) tx).getHibernate(); + Criteria criteria = session.createCriteria(TMSVersion.class); + List<?> list = criteria.list(); + TMSVersion result = list.isEmpty() ? null : (TMSVersion) list.get(0); + return result; + } catch (HibernateException e) { + throw new TopiaException("Could not obtain version", e); + } + } + + public static void createTable(Configuration configuration) { + // creer le schema en base + // dans la configuration il n'y a que la table version + SchemaExport schemaExport = new SchemaExport(configuration); + schemaExport.create(log.isDebugEnabled(), true); + } + + public static void dropTable(Configuration configuration) { + // supprimer le schema en base + // dans la configuration il n'y a que la table version + SchemaExport schemaExport = new SchemaExport(configuration); + schemaExport.drop(log.isDebugEnabled(), true); + } + + public static TMSVersion create(TopiaContext tx, String version) throws TopiaException { + + try { + Session session = ((TopiaContextImplementor) tx).getHibernate(); + + TMSVersion result = TMSVersion.valueOf(version); + // save entity + session.save(result); + return result; + } catch (HibernateException e) { + throw new TopiaException("Could not create version " + version, e); + } + } + + public static void update(TopiaContext tx, TMSVersion version) throws TopiaException { + try { + Session session = ((TopiaContextImplementor) tx).getHibernate(); + session.saveOrUpdate(version); + tx.commitTransaction(); + } catch (HibernateException e) { + throw new TopiaException("Could not update version " + version, e); + } + } + + public static void deleteAll(TopiaContext tx) throws TopiaException { + try { + Session session = ((TopiaContextImplementor) tx).getHibernate(); + Criteria criteria = session.createCriteria(TMSVersion.class); + List<?> list = criteria.list(); + for (Object o : list) { + session.delete(o); + } + } catch (HibernateException e) { + throw new TopiaException("Could not delete all versions", e); + } + } + + public static final String MAPPING = + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + + "<!DOCTYPE hibernate-mapping PUBLIC \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n" + + "<hibernate-mapping>\n" + + " <class name=\"org.nuiton.topia.migration.mappings.TMSVersion\" table=\"" + TABLE_NAME + "\">\n" + + " <id column=\"version\" name=\"version\"/>\n" + + " </class>\n" + + "</hibernate-mapping>"; + + public static final String LEGACY_MAPPING = + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + + "<!DOCTYPE hibernate-mapping PUBLIC \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n" + + "<hibernate-mapping>\n" + + " <class name=\"org.nuiton.topia.migration.mappings.TMSVersion\" table=\"" + LEGACY_TABLE_NAME + "\">\n" + + " <id column=\"version\" name=\"version\"/>\n" + + " </class>\n" + + "</hibernate-mapping>"; + + public static Version getVersion(TopiaContext tx, String tableName) { + try { + GetVersionWork work = new GetVersionWork(tableName); + ((TopiaContextImplementor) tx).getHibernate().doWork(work); + Version v = work.getVersion(); + return v; + } catch (TopiaException e) { + throw new TopiaRuntimeException("Can't obtain dbVersion for reason " + e.getMessage(), e); + } + } + + public static class GetVersionWork implements Work { + + Version version; + + private final String tableName; + + public GetVersionWork(String tableName) { + this.tableName = tableName; + } + + @Override + public void execute(Connection connection) throws SQLException { + PreparedStatement st = connection.prepareStatement("select " + TMSVersion.PROPERTY_VERSION + " from " + tableName + ";"); + try { + ResultSet set = st.executeQuery(); + + if (set.next()) { + version = VersionUtil.valueOf(set.getString(1)); + } + } finally { + + st.close(); + } + } + + public Version getVersion() { + return version; + } + } +} \ No newline at end of file Property changes on: trunk/topia-service-migration/src/main/java/org/nuiton/topia/migration/mappings/TMSVersionDAO.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/TMSVersionImpl.hbm.xml =================================================================== --- trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/TMSVersionImpl.hbm.xml (rev 0) +++ trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/TMSVersionImpl.hbm.xml 2010-06-13 17:48:26 UTC (rev 2009) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> + <!-- ce fichier de mapping sera supprimee apres la version 2.4 car plus utilise --> +<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> +<hibernate-mapping default-access="field" auto-import="true" package="org.nuiton.topia.migration"> + <class name="org.nuiton.topia.migration.TMSVersionImpl" table="tMSVersion" node="org.nuiton.topia.migration.TMSVersionImpl" abstract="false" proxy="org.nuiton.topia.migration.TMSVersion" > + <id name="topiaId" type="string" length="255" node="@topiaId"/> + <version name="topiaVersion" type="long" node="@topiaVersion"/> + <property name="topiaCreateDate" type="timestamp" node="@topiaCreateDate"/> + <property name="version" type="java.lang.String" access="field" column="version" node="version"/> + </class> +</hibernate-mapping> Property changes on: trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/TMSVersionImpl.hbm.xml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml =================================================================== --- trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml 2010-06-13 17:30:39 UTC (rev 2008) +++ trunk/topia-service-migration/src/main/resources/org/nuiton/topia/migration/mappings/TMSVersion.hbm.xml 2010-06-13 17:48:26 UTC (rev 2009) @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> + <!-- ce fichier de mapping sera supprimee apres la version 2.4 car plus utilise --> <hibernate-mapping> <class name="org.nuiton.topia.migration.mappings.TMSVersion" table="tms_version"> <id column="version" name="version"/>
participants (1)
-
tchemit@users.nuiton.org