org.dbmaintain
Interface DbMaintainer

All Known Implementing Classes:
DefaultDbMaintainer

public interface DbMaintainer

Defines the contract for classes that perform automatic maintenance of a database.

The updateDatabase(boolean) operation can be used to bring the database to the latest version. The markDatabaseAsUpToDate() operation updates the state of the database to indicate that all scripts have been executed, without actually executing them.

Author:
Filip Neven, Tim Ducheyne

Method Summary
 void markDatabaseAsUpToDate()
          This operation updates the state of the database to indicate that all scripts have been executed, without actually executing them.
 boolean updateDatabase(boolean dryRun)
          This operation can be used to bring the database to the latest version.
 

Method Detail

updateDatabase

boolean updateDatabase(boolean dryRun)
This operation can be used to bring the database to the latest version. First it checks which scripts were already applied to the database and executes the new scripts or the updated repeatable scripts. If an existing incremental script was changed, removed, or if a new incremental script has been added with a lower index than one that was already executed, an error is given; unless the option is enabled: in that case all database objects are removed and the database is rebuilt from scratch. If there are post-processing scripts, these are always executed at the end.

Parameters:
dryRun - if true, no updates have to be performed on the database - we do a simulation of the database update instead of actually performing the database update.
Returns:
whether updates were performed on the database

markDatabaseAsUpToDate

void markDatabaseAsUpToDate()
This operation updates the state of the database to indicate that all scripts have been executed, without actually executing them. This can be useful when you want to start using DbMaintain on an existing database, or after having fixed a problem directly on the database.



Copyright © 2011. All Rights Reserved.