bucket.core.persistence.hibernate.schema
Class SchemaHelper

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

@NotThreadSafe
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


Field Summary
static java.lang.String COMPONENT_REFERENCE
           
 
Constructor Summary
SchemaHelper()
          Deprecated. since 5.6, use SchemaHelper(Iterable, java.util.Properties)
SchemaHelper(java.lang.Iterable<java.lang.String> mappingResources, com.atlassian.config.db.HibernateConfig hibernateConfig)
           
SchemaHelper(java.lang.Iterable<java.lang.String> mappingResources, java.util.Properties hibernateProperties)
           
 
Method Summary
 void addMappingResources(java.util.List<java.lang.String> mappings)
          Deprecated. since 5.6, use a lazy Iterable in conjunction with SchemaHelper(Iterable, java.util.Properties)
 void createTables()
           
 void dropTables()
           
 net.sf.hibernate.cfg.Configuration getConfiguration()
           
 MappingResources getMappingResources()
          Deprecated. since 5.6, use getMappingResourcesView()
 java.lang.Iterable<java.lang.String> getMappingResourcesView()
           
 void recreateDatabase()
           
 void setConfiguration(net.sf.hibernate.cfg.Configuration configuration)
          Deprecated. since 5.6, use #SchemaHelper(com.atlassian.util.concurrent.Supplier)
 void setHibernateConfig(com.atlassian.config.db.HibernateConfig hibernateConfig)
          Deprecated. since 5.6, use SchemaHelper(Iterable, java.util.Properties)
 void setHibernateProperties(java.util.Properties hibernateConfigProperties)
          Deprecated. since 5.6, use SchemaHelper(Iterable, java.util.Properties)
 void setMappingResources(MappingResources mappings)
          Deprecated. since 5.6, use a lazy Iterable in conjunction with SchemaHelper(Iterable, java.util.Properties)
 void updateSchemaIfNeeded()
          If there are any updates to the Schema needed, do them.
 void updateSchemaIfNeeded(boolean showDDL)
           
 void validateSchemaUpdateIfNeeded()
           
 
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

@Deprecated
public SchemaHelper()
Deprecated. since 5.6, use SchemaHelper(Iterable, java.util.Properties)


SchemaHelper

public SchemaHelper(java.lang.Iterable<java.lang.String> mappingResources,
                    com.atlassian.config.db.HibernateConfig hibernateConfig)

SchemaHelper

public SchemaHelper(java.lang.Iterable<java.lang.String> mappingResources,
                    java.util.Properties hibernateProperties)
Method Detail

setHibernateProperties

@Deprecated
public void setHibernateProperties(java.util.Properties hibernateConfigProperties)
Deprecated. since 5.6, use SchemaHelper(Iterable, java.util.Properties)


setHibernateConfig

@Deprecated
public void setHibernateConfig(com.atlassian.config.db.HibernateConfig hibernateConfig)
Deprecated. since 5.6, use SchemaHelper(Iterable, java.util.Properties)


getConfiguration

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

setConfiguration

@Deprecated
public void setConfiguration(net.sf.hibernate.cfg.Configuration configuration)
Deprecated. since 5.6, use #SchemaHelper(com.atlassian.util.concurrent.Supplier)

Parameters:
configuration - The config to set.

getMappingResources

@Deprecated
public MappingResources getMappingResources()
Deprecated. since 5.6, use getMappingResourcesView()

Returns:
Returns the mappings.

setMappingResources

@Deprecated
public void setMappingResources(MappingResources mappings)
Deprecated. since 5.6, use a lazy Iterable in conjunction with SchemaHelper(Iterable, java.util.Properties)

Parameters:
mappings - The mappings to set.

addMappingResources

@Deprecated
public void addMappingResources(java.util.List<java.lang.String> mappings)
Deprecated. since 5.6, use a lazy Iterable in conjunction with SchemaHelper(Iterable, java.util.Properties)


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

validateSchemaUpdateIfNeeded

public void validateSchemaUpdateIfNeeded()
                                  throws com.atlassian.config.ConfigurationException
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

getMappingResourcesView

public java.lang.Iterable<java.lang.String> getMappingResourcesView()


Copyright © 2003-2014 Atlassian. All Rights Reserved.