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 |
DB_H2
public static final String DB_H2
- See Also:
- Constant Field Values
DB_POSTGRES
public static final String DB_POSTGRES
- See Also:
- Constant Field Values
DB_MYSQL
public static final String DB_MYSQL
- See Also:
- Constant Field Values
DB_ORACLE
public static final String DB_ORACLE
- See Also:
- Constant Field Values
DB_SQLSERVER
public static final String DB_SQLSERVER
- See Also:
- Constant Field Values
DB_DB2
public static final String DB_DB2
- See Also:
- Constant Field Values
hibernateSessionFactoryProvider
@Inject
protected HibernateSessionFactoryProvider hibernateSessionFactoryProvider
databaseAutoSynchronizer
@Inject
protected DatabaseAutoSynchronizer databaseAutoSynchronizer
databaseSourceManager
@Inject
protected DataSourceManager databaseSourceManager
supportedDialects
@Inject
protected Map<String,String> supportedDialects
nativeToSequenceReplaceableDialects
@Inject
protected String[] nativeToSequenceReplaceableDialects
nativeToHiloReplaceableDialects
@Inject
protected String[] nativeToHiloReplaceableDialects
verificationExcludedClassNames
@Inject
protected String[] verificationExcludedClassNames
hbmConfig
protected org.hibernate.cfg.Configuration hbmConfig
databaseName
protected String databaseName
localDataSource
protected DataSource localDataSource
HibernateInitializer
public HibernateInitializer()
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
getDatabaseName
public String getDatabaseName()
isOracleDatabase
public boolean isOracleDatabase()
isPostgresDatabase
public boolean isPostgresDatabase()
isSQLServerDatabase
public boolean isSQLServerDatabase()
isMySQLDatabase
public boolean isMySQLDatabase()
isH2Database
public boolean isH2Database()
isDB2Database
public boolean isDB2Database()
isDatabase
protected boolean isDatabase(String dbId)
getLocalDataSource
public DataSource getLocalDataSource()
throws Exception
- Throws:
Exception
inferDatabaseName
protected String inferDatabaseName()
throws Exception
- Throws:
Exception
inferDatabaseName
public String inferDatabaseName(DataSource ds)
throws Exception
- Throws:
Exception
verifyHibernateConfig
protected void verifyHibernateConfig()
throws Exception
- Throws:
Exception
loadHibernateDescriptors
protected void loadHibernateDescriptors(org.hibernate.cfg.Configuration hbmConfig)
throws IOException
- Throws:
IOException
readXMLForFile
protected String readXMLForFile(String fileName,
InputStream is)
throws IOException
- Throws:
IOException
processXMLContents
protected String processXMLContents(String fileContent)
evictAllCaches
public void evictAllCaches()
- Evict all cache information.
Copyright © 2012-2013 JBoss by Red Hat. All Rights Reserved.