com.google.code.flyway.core.java
Class BaseJavaMigration

java.lang.Object
  extended by com.google.code.flyway.core.Migration
      extended by com.google.code.flyway.core.BaseMigration
          extended by com.google.code.flyway.core.java.BaseJavaMigration

public abstract class BaseJavaMigration
extends BaseMigration

Base class for java migration classes whose name conforms to the Flyway standard.


Field Summary
 
Fields inherited from class com.google.code.flyway.core.Migration
executionTime, migrationState, schemaVersion, scriptName
 
Constructor Summary
protected BaseJavaMigration()
          Initializes this Migration with this standard Flyway name.
 
Method Summary
protected  void doMigrate(org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, DbSupport dbSupport)
          Performs the migration.
protected abstract  void doMigrateInTransaction(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, DbSupport dbSupport)
          Performs the migration inside a transaction.
 
Methods inherited from class com.google.code.flyway.core.BaseMigration
initVersion
 
Methods inherited from class com.google.code.flyway.core.Migration
assertNotFailed, getExecutionTime, getScriptName, getState, getVersion, migrate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseJavaMigration

protected BaseJavaMigration()
Initializes this Migration with this standard Flyway name.

Method Detail

doMigrate

protected void doMigrate(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
                         org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
                         DbSupport dbSupport)
                  throws org.springframework.dao.DataAccessException
Performs the migration.

Overrides:
doMigrate in class Migration
Parameters:
transactionTemplate - The transaction template to use.
jdbcTemplate - To execute the migration statements.
dbSupport - The support for database-specific extensions.
Throws:
org.springframework.dao.DataAccessException - Thrown when the migration failed.

doMigrateInTransaction

protected abstract void doMigrateInTransaction(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
                                               DbSupport dbSupport)
                                        throws org.springframework.dao.DataAccessException
Performs the migration inside a transaction.

Parameters:
jdbcTemplate - To execute the migration statements.
dbSupport - The support for database-specific extensions.
Throws:
org.springframework.dao.DataAccessException - Thrown when the migration failed.


Copyright © 2010. All Rights Reserved.