bucket.core.persistence.hibernate.schema
Class SchemaHelper

java.lang.Object
  extended by bucket.core.persistence.hibernate.schema.SchemaHelper

public class SchemaHelper
extends java.lang.Object

Replaces functionality in the ConfluenceHibernateSetup for running schema actions against a database. This implermentation is a Spring-ified object that can be created and managed by an IoC container //FIX Note: Spring are introducing a static bean factory allowing use to remove the default constructor here we should update this on the next release of spring


Field Summary
static java.lang.String COMPONENT_REFERENCE
           
 
Constructor Summary
SchemaHelper()
           
 
Method Summary
 void addMappingResources(java.util.List mappings)
           
 void createTables()
           
 void dropTables()
           
 net.sf.hibernate.cfg.Configuration getConfiguration()
           
 MappingResources getMappingResources()
           
 void recreateDatabase()
           
 void setConfiguration(net.sf.hibernate.cfg.Configuration configuration)
           
 void setHibernateConfig(com.atlassian.config.db.HibernateConfig hibernateConfig)
           
 void setHibernateProperties(java.util.Properties props)
           
 void setMappingResources(MappingResources mappings)
           
 void updateSchemaIfNeeded()
          If there are any updates to the Schema needed, do them.
 void updateSchemaIfNeeded(boolean showDDL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_REFERENCE

public static final java.lang.String COMPONENT_REFERENCE
See Also:
Constant Field Values
Constructor Detail

SchemaHelper

public SchemaHelper()
Method Detail

setHibernateProperties

public void setHibernateProperties(java.util.Properties props)

setHibernateConfig

public void setHibernateConfig(com.atlassian.config.db.HibernateConfig hibernateConfig)

getConfiguration

public net.sf.hibernate.cfg.Configuration getConfiguration()
                                                    throws net.sf.hibernate.MappingException
Returns:
Returns the config.
Throws:
net.sf.hibernate.MappingException

setConfiguration

public void setConfiguration(net.sf.hibernate.cfg.Configuration configuration)
Parameters:
configuration - The config to set.

getMappingResources

public MappingResources getMappingResources()
Returns:
Returns the mappings.

setMappingResources

public void setMappingResources(MappingResources mappings)
Parameters:
mappings - The mappings to set.

addMappingResources

public void addMappingResources(java.util.List mappings)

recreateDatabase

public void recreateDatabase()
                      throws com.atlassian.config.ConfigurationException
Throws:
com.atlassian.config.ConfigurationException

dropTables

public void dropTables()
                throws com.atlassian.config.ConfigurationException
Throws:
com.atlassian.config.ConfigurationException

createTables

public void createTables()
                  throws com.atlassian.config.ConfigurationException
Throws:
com.atlassian.config.ConfigurationException

updateSchemaIfNeeded

public void updateSchemaIfNeeded()
                          throws com.atlassian.config.ConfigurationException
If there are any updates to the Schema needed, do them.

Throws:
com.atlassian.config.ConfigurationException

updateSchemaIfNeeded

public void updateSchemaIfNeeded(boolean showDDL)
                          throws com.atlassian.config.ConfigurationException
Parameters:
showDDL - - false will output DDL to stdout
Throws:
com.atlassian.config.ConfigurationException


Copyright © 2003-2010 Atlassian. All Rights Reserved.