public interface DatabaseSchemaDao
Modifier and Type | Method and Description |
---|---|
void |
generateCreateSchemaFile(String filename)
Generate a file with all SQL for database creation
|
void |
generateCreateSchemaFile(String filename,
boolean doExecute,
boolean withDrop,
boolean withCreate) |
void |
generateDiffChangeLog(File outputChangelogFile,
String typesToControl)
Generate a diff change log
|
void |
generateDiffReport(File outputFile,
String typesToControl)
Generate a diff of database
|
void |
generateStatusReport(File outputFile)
Report into a file the liquibase status of database
|
void |
generateUpdateSchemaFile(String filename)
Generate a file with update SQL statement.
|
void |
generateUpdateSchemaFile(String filename,
boolean doUpdate)
Generate a file with update SQL statement, and/or execute it on database.
|
Version |
getSchemaVersion()
Retrieve the schema version, from table SYSTEM_VERSION,
|
Version |
getSchemaVersionIfUpdate()
Get the database schema version if updates is apply
(the version that the database should have if updateSchema() was called)
|
boolean |
isDbExists()
Check if db files exists.
|
boolean |
isDbLoaded()
Check if connection could be open.
|
boolean |
shouldUpdateSchema()
Check if a update schema if need
This is equivalent to :
getSchemaVersion().compareTo(getSchemaVersionIfUpdate()) >= 0 |
void |
updateSchema()
Execute all changes need on database schema
|
void generateCreateSchemaFile(String filename)
filename
- full path of the file to generatevoid generateCreateSchemaFile(String filename, boolean doExecute, boolean withDrop, boolean withCreate)
filename
- The file to generate, or null if only execution is needdoExecute
- The SQL script must be execute on database ?withDrop
- generate drop statement ?withCreate
- generate create statement ?void generateUpdateSchemaFile(String filename)
filename
- void generateUpdateSchemaFile(String filename, boolean doUpdate)
filename
- The file to generate, or null if only execution on database is needdoUpdate
- true if execution is need on databasevoid updateSchema() throws DatabaseSchemaUpdateException
DatabaseSchemaUpdateException
- if could not update schemaVersion getSchemaVersion() throws VersionNotFoundException
VersionNotFoundException
- if the version could not be found, or has a bad formatVersion getSchemaVersionIfUpdate()
boolean shouldUpdateSchema() throws VersionNotFoundException
getSchemaVersion().compareTo(getSchemaVersionIfUpdate()) >= 0
VersionNotFoundException
boolean isDbLoaded()
boolean isDbExists()
void generateStatusReport(File outputFile) throws IOException
IOException
void generateDiffReport(File outputFile, String typesToControl) throws IOException
typesToControl
- a comma separated database object to check (i.e Table, View, Column...). If null, all types are checkedIOException
void generateDiffChangeLog(File outputChangelogFile, String typesToControl) throws IOException
typesToControl
- a comma separated database object to check (i.e Table, View, Column...). If null, all types are checkedIOException
Copyright © 2012–2014 IFREMER. All rights reserved.