public class

SchemaHelper

extends Object
java.lang.Object
   ↳ bucket.core.persistence.hibernate.schema.SchemaHelper

Class Overview

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

Summary

Constants
String COMPONENT_REFERENCE
Public Constructors
SchemaHelper()
Public Methods
void addMappingResources(List mappings)
void createTables()
void dropTables()
Configuration getConfiguration()
MappingResources getMappingResources()
void recreateDatabase()
void setConfiguration(Configuration configuration)
void setHibernateConfig(HibernateConfig hibernateConfig)
void setHibernateProperties(Properties props)
void setMappingResources(MappingResources mappings)
void updateSchemaIfNeeded(boolean showDDL)
void updateSchemaIfNeeded()
If there are any updates to the Schema needed, do them.
void validateSchemaUpdateIfNeeded()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String COMPONENT_REFERENCE

Constant Value: "schemaHelper"

Public Constructors

public SchemaHelper ()

Public Methods

public void addMappingResources (List mappings)

public void createTables ()

Throws
ConfigurationException

public void dropTables ()

Throws
ConfigurationException

public Configuration getConfiguration ()

Returns
  • Returns the config.
Throws
MappingException

public MappingResources getMappingResources ()

Returns
  • Returns the mappings.

public void recreateDatabase ()

Throws
ConfigurationException

public void setConfiguration (Configuration configuration)

Parameters
configuration The config to set.

public void setHibernateConfig (HibernateConfig hibernateConfig)

public void setHibernateProperties (Properties props)

public void setMappingResources (MappingResources mappings)

Parameters
mappings The mappings to set.

public void updateSchemaIfNeeded (boolean showDDL)

Parameters
showDDL - false will output DDL to stdout
Throws
ConfigurationException

public void updateSchemaIfNeeded ()

If there are any updates to the Schema needed, do them.

Throws
ConfigurationException

public void validateSchemaUpdateIfNeeded ()

Throws
ConfigurationException