org.clazzes.jdbc2xml.schema
Class SchemaManager
java.lang.Object
org.clazzes.jdbc2xml.schema.SchemaManager
public class SchemaManager
- extends Object
Bean for initial database setup.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VERSION_HISTORY
public static final TableInfo VERSION_HISTORY
SchemaManager
public SchemaManager()
start
public void start()
throws SchemaManagementException
- Setup-method. Checks if the schema-history table exists; if it does, it attempts to run a schema-update, otherwise
the database is set up according to the
TableInfo
s saved in baseTables
, and then runs an
update.
- Throws:
SchemaManagementException
setupDB
protected void setupDB()
throws SchemaManagementException
- Sets up the tables as described in
baseTables
.
- Throws:
SchemaManagementException
initUpdate
protected void initUpdate()
throws SchemaManagementException
- Triggers a schema-update.
- Throws:
SchemaManagementException
SQLException
- because this method should only be called inside a try-catch block.
getDataSource
public DataSource getDataSource()
- Returns:
- the dataSource
setDataSource
public void setDataSource(DataSource dataSource)
- Parameters:
dataSource
- the dataSource to set
getSchemaEngine
public ISchemaEngine getSchemaEngine()
- Returns:
- the schemaEngine
setSchemaEngine
public void setSchemaEngine(ISchemaEngine schemaEngine)
- Parameters:
schemaEngine
- the schemaEngine to set
getBaseVersion
public String getBaseVersion()
- Returns:
- The initial schema version.
setBaseVersion
public void setBaseVersion(String baseVersion)
- Parameters:
baseVersion
- The initial version to set.
getBaseDescription
public String getBaseDescription()
- Returns:
- The description of the initial database version.
setBaseDescription
public void setBaseDescription(String baseDescription)
- Parameters:
baseDescription
- The description of the initial database version.
getBaseTables
public List<TableInfo> getBaseTables()
- Returns:
- The list of tables in the initial database setup.
setBaseTables
public void setBaseTables(List<TableInfo> tables)
- Parameters:
tables
- The list of tables in the initial database setup to set.
getUpateSnippets
public Map<String,Class<? extends ISchemaUpdateSnippet>> getUpateSnippets()
- Returns:
- The map of update snippets keyed to their originating version.
setUpateSnippets
public void setUpateSnippets(Map<String,Class<? extends ISchemaUpdateSnippet>> upateSnippets)
- Parameters:
upateSnippets
- The map of update snippets keyed to their originating version.
Copyright © 2012. All Rights Reserved.