|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.flyway.core.dbsupport.DbSupport
public abstract class DbSupport
Abstraction for database-specific functionality.
| Field Summary | |
|---|---|
protected JdbcTemplate |
jdbcTemplate
The JDBC template available for use. |
| Constructor Summary | |
|---|---|
DbSupport(JdbcTemplate jdbcTemplate)
Creates a new DbSupport instance with this JdbcTemplate. |
|
| Method Summary | |
|---|---|
abstract SqlScript |
createCleanScript(java.lang.String schema)
Creates a new sql script which clean this schema, by dropping all objects. |
abstract SqlScript |
createSqlScript(java.lang.String sqlScriptSource,
PlaceholderReplacer placeholderReplacer)
Creates a new sql script from this resource with these placeholders to replace. |
abstract java.lang.String |
getBooleanFalse()
|
abstract java.lang.String |
getBooleanTrue()
|
abstract java.lang.String |
getCurrentSchema()
Retrieves the current schema. |
abstract java.lang.String |
getCurrentUserFunction()
|
JdbcTemplate |
getJdbcTemplate()
|
abstract java.lang.String |
getScriptLocation()
Returns the location on the classpath where the scripts for this database reside. |
abstract boolean |
isSchemaEmpty(java.lang.String schema)
Checks if this database schema is empty. |
abstract void |
lockTable(java.lang.String schema,
java.lang.String table)
Locks this table in this schema using a read/write pessimistic lock until the end of the current transaction. |
abstract boolean |
supportsDdlTransactions()
Checks whether ddl transactions are supported for this database. |
abstract boolean |
tableExists(java.lang.String schema,
java.lang.String table)
Checks whether this table is already present in the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final JdbcTemplate jdbcTemplate
| Constructor Detail |
|---|
public DbSupport(JdbcTemplate jdbcTemplate)
jdbcTemplate - The JDBC template to use.| Method Detail |
|---|
public JdbcTemplate getJdbcTemplate()
public abstract SqlScript createSqlScript(java.lang.String sqlScriptSource,
PlaceholderReplacer placeholderReplacer)
sqlScriptSource - The sql script as a text block with all placeholders still present.placeholderReplacer - The placeholder replacer to apply to sql migration scripts.
java.lang.IllegalStateException - Thrown when the script could not be read from this resource.
public abstract SqlScript createCleanScript(java.lang.String schema)
throws java.sql.SQLException
schema - The schema to clean.
java.sql.SQLException - when querying the database for generating the clean script failed.public abstract java.lang.String getScriptLocation()
public abstract boolean isSchemaEmpty(java.lang.String schema)
throws java.sql.SQLException
schema - The schema to check.
true if it is empty, false if it is not.
java.sql.SQLException - when there was an error checking whether the schema is empty.
public abstract boolean tableExists(java.lang.String schema,
java.lang.String table)
throws java.sql.SQLException
schema - The schema in which to look.table - The table to look for.
true if the table exists, false if it doesn't.
java.sql.SQLException - when there was an error checking whether this table exists in this schema.
public abstract java.lang.String getCurrentSchema()
throws java.sql.SQLException
java.sql.SQLException - when the current schema could not be retrieved.public abstract java.lang.String getCurrentUserFunction()
public abstract boolean supportsDdlTransactions()
true if ddl transactions are supported, false if not.
public abstract void lockTable(java.lang.String schema,
java.lang.String table)
throws java.sql.SQLException
schema - The schema of the table to lock.table - The table to lock.
java.sql.SQLException - when this table in this schema could not be locked.public abstract java.lang.String getBooleanTrue()
true in a boolean column.public abstract java.lang.String getBooleanFalse()
false in a boolean column.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||