org.nuiton.topia.migration.kernel
Class ConfigurationHelper

java.lang.Object
  extended by org.nuiton.topia.migration.kernel.ConfigurationHelper

public class ConfigurationHelper
extends Object

ConfigurationHelper.java Charge des configuration en mode "dynamic-map".

Version:
$Revision: 1459 $ Last update : $Date: 2009-05-16 09:56:47 +0200 (Sat, 16 May 2009) $
Author:
Chatellier Eric, Chevallereau Benjamin, Eon Sébastien, Trève Vincent

Field Summary
protected static ConfigurationHelper instance
          Single instance
 
Constructor Summary
protected ConfigurationHelper()
          Constructeur
 
Method Summary
 org.hibernate.cfg.Configuration getConfigurationInDirectory(String pathDirectory)
          Retourne une configuration correspondant au chargement de tous les mappings du dossier specifie.
protected static DocumentBuilder getDocumentBuilder()
          Recopie, elle est protected dans lutin xml
protected static Document getDocumentResolvedByHibernate(String xmlString)
          Construit un nouveau document a partir du flux
protected static org.dom4j.Document getDom4jDocument(URL fichier)
          Charge un document dom4j
protected static String getEntityMappingFromFile(URL fichier)
          Charge un fichier et retourne un mapping valide pour etre manipule via les map
static ConfigurationHelper getInstance()
          Get single instance
protected static org.dom4j.Document transformAsValidHibernateMapConfigFile(org.dom4j.Document dom4jdoc)
          Transforme en ajoutant des info de mappings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static ConfigurationHelper instance
Single instance

Constructor Detail

ConfigurationHelper

protected ConfigurationHelper()
Constructeur

Method Detail

getInstance

public static ConfigurationHelper getInstance()
Get single instance

Returns:
the shared instance

getConfigurationInDirectory

public org.hibernate.cfg.Configuration getConfigurationInDirectory(String pathDirectory)
Retourne une configuration correspondant au chargement de tous les mappings du dossier specifie. Ici, on pourrait utiliser configuration.addDirectory mais on modifie les mappings version "entity-map"

Parameters:
pathDirectory - Le dossier ou se trouvent les mappings (contient la version souhaitee)
Returns:
La configuration associee

getEntityMappingFromFile

protected static String getEntityMappingFromFile(URL fichier)
Charge un fichier et retourne un mapping valide pour etre manipule via les map

Parameters:
fichier - le nom du fichier
Returns:
le mapping en forme xml

transformAsValidHibernateMapConfigFile

protected static org.dom4j.Document transformAsValidHibernateMapConfigFile(org.dom4j.Document dom4jdoc)
Transforme en ajoutant des info de mappings. Ajoute un entity-name avec la valeur de name. Supprime name , sinon hibernate l'utilise encore.

Parameters:
dom4jdoc - le document
Returns:
un document mapping entite

getDom4jDocument

protected static org.dom4j.Document getDom4jDocument(URL fichier)
Charge un document dom4j

Parameters:
fichier - le nom du fichier
Returns:
un document dom4j

getDocumentResolvedByHibernate

protected static Document getDocumentResolvedByHibernate(String xmlString)
Construit un nouveau document a partir du flux

Parameters:
xmlString - el flux d'entree
Returns:
le document construit

getDocumentBuilder

protected static DocumentBuilder getDocumentBuilder()
Recopie, elle est protected dans lutin xml

Returns:
un DocumentBuilder


Copyright © 2004-2010 CodeLutin. All Rights Reserved.