|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.figure8.join.core.setup.HibernateConfigurator
public class HibernateConfigurator
Helper object for configuring Hibernate and its SessionFactory
Field Summary | |
---|---|
protected static java.lang.String |
HBN_PROPERTIES_PREFIX
Prefix of application properties related to hibernate. |
static java.lang.String |
HBN_SETUP_PROPERTY
Name of application property telling if Hibernate has been setup |
protected static org.apache.commons.logging.Log |
log
Get a commons logger. |
Constructor Summary | |
---|---|
HibernateConfigurator()
Creates a new instance of HibernateConfigurator |
Method Summary | |
---|---|
void |
configureDatabase(DatabaseDetails details,
boolean embedded)
Configure Hibernate according to the given database details |
void |
configureDatasource(java.lang.String datasourceName,
java.lang.String dialect)
Configure Hibernate according to the given datasource JNDI name. |
protected void |
configureHibernate(java.util.Properties properties)
Do the real job by filling application with Hibernate properties and creating the database schema if needed. |
ApplicationConfig |
getApplicationConfig()
|
java.util.Properties |
getHibernateProperties()
Extract hibernate related properties from ApplicationConfig. |
void |
setApplicationConfig(ApplicationConfig config)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected static final java.lang.String HBN_PROPERTIES_PREFIX
public static final java.lang.String HBN_SETUP_PROPERTY
Constructor Detail |
---|
public HibernateConfigurator()
Method Detail |
---|
public void setApplicationConfig(ApplicationConfig config)
config
- ApplicationConfig
instancepublic ApplicationConfig getApplicationConfig()
ApplicationConfig
instance used.public java.util.Properties getHibernateProperties()
public void configureDatabase(DatabaseDetails details, boolean embedded) throws BootstrapException
details
- Wrapper object for database connection detailsembedded
- Boolean telling if database to use is embedded (HSQLDB)
BootstrapException
- if application config cannot be updatedpublic void configureDatasource(java.lang.String datasourceName, java.lang.String dialect) throws BootstrapException
datasourceName
- JNDI name of the datasource to use for connectionsdialect
- SQL dialect implementation of the database behind datasource
BootstrapException
- if application config cannot be updatedprotected void configureHibernate(java.util.Properties properties) throws BootstrapException
properties
- Hibernate specific properties (starting with "hibernate.")
BootstrapException
- if configuration backup or schema update fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |