org.jboss.dashboard.database.hibernate
Class HibernateInitializer
java.lang.Object
org.jboss.dashboard.database.hibernate.HibernateInitializer
- All Implemented Interfaces:
- Startable
@ApplicationScoped
public class HibernateInitializer
- extends Object
- implements Startable
Class that initializes the Hibernate framework. It reads all the *.hbm.xml files and push them as part of the
Hibernate configuration. Furthermore, initializes a SessionFactory object that will be used further by transactions.
To do so it reads first the configuration stored into the HibernateProperties factory bean.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
performNativeToHiloReplace
@Inject
protected boolean performNativeToHiloReplace
nativeToHiloReplaceableDialects
@Inject
protected String[] nativeToHiloReplaceableDialects
enableDatabaseStructureVerification
@Inject
protected boolean enableDatabaseStructureVerification
enableDatabaseAutoSynchronization
@Inject
protected boolean enableDatabaseAutoSynchronization
databaseStructureVerificationExcludedClassNames
@Inject
protected String[] databaseStructureVerificationExcludedClassNames
hibernateSessionFactoryProvider
@Inject
protected HibernateSessionFactoryProvider hibernateSessionFactoryProvider
databaseAutoSynchronizer
@Inject
protected DatabaseAutoSynchronizer databaseAutoSynchronizer
hbmConfig
protected org.hibernate.cfg.Configuration hbmConfig
databaseName
protected String databaseName
c3p0Enabled
protected boolean c3p0Enabled
cacheEnabled
protected boolean cacheEnabled
processedJars
protected List processedJars
HibernateInitializer
public HibernateInitializer()
getHibernateProperties
public Properties getHibernateProperties()
getCacheConfigurationManager
public CacheConfigurationManager getCacheConfigurationManager()
getDatabaseAutoSynchronizer
public DatabaseAutoSynchronizer getDatabaseAutoSynchronizer()
isEnableDatabaseStructureVerification
public boolean isEnableDatabaseStructureVerification()
setEnableDatabaseStructureVerification
public void setEnableDatabaseStructureVerification(boolean enableDatabaseStructureVerification)
getHbmConfig
public org.hibernate.cfg.Configuration getHbmConfig()
isPerformNativeToHiloReplace
public boolean isPerformNativeToHiloReplace()
setPerformNativeToHiloReplace
public void setPerformNativeToHiloReplace(boolean performNativeToHiloReplace)
getNativeToHiloReplaceableDialects
public String[] getNativeToHiloReplaceableDialects()
setNativeToHiloReplaceableDialects
public void setNativeToHiloReplaceableDialects(String[] nativeToHiloReplaceableDialects)
getDatabaseStructureVerificationExcludedClassNames
public String[] getDatabaseStructureVerificationExcludedClassNames()
setDatabaseStructureVerificationExcludedClassNames
public void setDatabaseStructureVerificationExcludedClassNames(String[] databaseStructureVerificationExcludedClassNames)
isC3p0Enabled
public boolean isC3p0Enabled()
setC3p0Enabled
public void setC3p0Enabled(boolean c3p0Enabled)
isCacheEnabled
public boolean isCacheEnabled()
setCacheEnabled
public void setCacheEnabled(boolean cacheEnabled)
isEnableDatabaseAutoSynchronization
public boolean isEnableDatabaseAutoSynchronization()
setEnableDatabaseAutoSynchronization
public void setEnableDatabaseAutoSynchronization(boolean enableDatabaseAutoSynchronization)
getSessionFactory
public org.hibernate.SessionFactory getSessionFactory()
getPriority
public Priority getPriority()
- Specified by:
getPriority in interface Startable
start
public void start()
throws Exception
- Specified by:
start in interface Startable
- Throws:
Exception
processHibernateProperties
protected void processHibernateProperties(Properties p)
verifyHibernateConfig
protected void verifyHibernateConfig()
throws Exception
- Throws:
Exception
loadFiles
protected void loadFiles(org.hibernate.cfg.Configuration hbmConfig)
throws IOException
- Throws:
IOException
loadFiles
protected void loadFiles(org.hibernate.cfg.Configuration hbmConfig,
File jarFile)
throws IOException
- Throws:
IOException
readXMLForFile
protected String readXMLForFile(InputStream is)
throws IOException
- Throws:
IOException
processXMLContents
protected String processXMLContents(String fileName,
String fileContent)
getDatabaseName
public String getDatabaseName()
evictAllCaches
public void evictAllCaches()
- Evict all cache information.
createCustomCacheRegion
public boolean createCustomCacheRegion(String regionName)
- Create a custom cache region
- Parameters:
regionName - name for the region
- Returns:
- true if it was created.
isOracleDatabase
public boolean isOracleDatabase()
isPostgresDatabase
public boolean isPostgresDatabase()
isSQLServerDatabase
public boolean isSQLServerDatabase()
isMySQLDatabase
public boolean isMySQLDatabase()
isH2Database
public boolean isH2Database()
isDatabase
protected boolean isDatabase(String dbId)
Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.