public abstract class AbstractDatabaseInitialization extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CREATE_PROCESS |
protected String |
databaseName |
protected String |
databasePassword |
protected Properties |
databaseProperties |
protected String |
databaseUser |
protected static String |
DELETE_PROCESS |
protected static String |
DROP_PROCESS |
protected String |
fileEncoding |
protected String |
host |
protected String |
initializationProcess |
protected boolean |
log |
protected boolean |
postgresDatabase |
| Constructor and Description |
|---|
AbstractDatabaseInitialization(Properties databaseProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
createInitializationScript(String processtype)
Creates the initialization script.
|
protected void |
createSchema(Connection jdbcConnection,
String processtype) |
protected void |
createSchemaFromScript(Connection jdbcConnection)
Creates the initialization script for the schema.
|
protected void |
deleteAndCreateEmptyDatabaseWithoutTables()
Deletes and creates an empty database without tables so without creating the database schema.
|
protected void |
dropTablesAndSequences(Connection jdbcConnection)
Drops all tables and sequences.
|
Properties |
getDatabaseProperties() |
protected File |
getInsertDir()
Gets the insert dir.
|
protected String |
getProcessType()
Gets the process type to execute.
|
protected abstract List<File> |
getScriptFiles() |
protected File |
getSqlDir()
Gets the sql dir.
|
void |
initializeDatabase() |
protected void |
initializeDatabase(Connection jdbcConnection)
Initialize database.
|
protected void |
initializeScriptFiles()
Initialize the script files from the generated schema file from the hibernate3-maven-plugin.
|
protected void |
newEmptyDatabaseWithoutTables()
Creates an empty database without tables and no database schema.
|
protected String |
replaceMediumblobToBytea(File schema) |
protected static final String DELETE_PROCESS
protected static final String CREATE_PROCESS
protected static final String DROP_PROCESS
protected final Properties databaseProperties
protected String host
protected String databaseName
protected String databaseUser
protected String databasePassword
protected String initializationProcess
protected String fileEncoding
protected boolean log
protected boolean postgresDatabase
public AbstractDatabaseInitialization(Properties databaseProperties)
public Properties getDatabaseProperties()
public void initializeDatabase()
throws ClassNotFoundException,
SQLException,
IOException
protected String getProcessType()
protected void deleteAndCreateEmptyDatabaseWithoutTables()
throws ClassNotFoundException,
SQLException
ClassNotFoundException - occurs if a class has not been foundSQLException - Signals that an sql error has occurred.protected void newEmptyDatabaseWithoutTables()
throws ClassNotFoundException,
SQLException
ClassNotFoundException - occurs if a class has not been foundSQLException - Signals that an sql error has occurred.protected File getInsertDir()
protected File getSqlDir()
protected void dropTablesAndSequences(Connection jdbcConnection) throws IOException, SQLException
jdbcConnection - the jdbc connectionIOException - Signals that an I/O exception has occurred.SQLException - Signals that an sql error has occurred.protected boolean createInitializationScript(String processtype) throws IOException
processtype - the processtypeIOException - Signals that an I/O exception has occurred.protected String replaceMediumblobToBytea(File schema) throws IOException
IOExceptionprotected void createSchema(Connection jdbcConnection, String processtype) throws FileNotFoundException, IOException, SQLException
protected void initializeScriptFiles()
throws FileNotFoundException,
IOException
FileNotFoundException - occurs if a class has not been foundIOException - Signals that an I/O exception has occurred.protected void createSchemaFromScript(Connection jdbcConnection) throws IOException, SQLException
jdbcConnection - the jdbc connectionIOException - Signals that an I/O exception has occurred.SQLException - Signals that an sql error has occurred.protected void initializeDatabase(Connection jdbcConnection) throws IOException, SQLException
jdbcConnection - the jdbc connectionIOException - Signals that an I/O exception has occurred.SQLException - Signals that an sql error has occurred.Copyright © 2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.