ERXMigration Class Reference

Inherits er::extensions::migration::IERXMigration.

Inherited by Movies0.

Collaboration diagram for ERXMigration:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void downgrade (EOEditingContext editingContext, EOAdaptorChannel channel, EOModel model) throws Throwable
 ERXMigration ()
 ERXMigration (boolean useDatabaseSpecificMigrations)
NSArray< ERXModelVersionmodelDependencies ()
void upgrade (EOEditingContext editingContext, EOAdaptorChannel channel, EOModel model) throws Throwable

Protected Member Functions

String getSQLForMigration (String migrationName)
String migrationBundleName ()
boolean useDatabaseSpecificMigrations ()

Private Attributes

Boolean _useDatabaseSpecificMigrations
Logger log = Logger.getLogger(ERXMigration.class.getName())


Detailed Description

Convenience superclass for Migration classes. Checks for corresponding sql files name "ClassnameX_Upgrade.migration" and "ClassnameX_Downgrade.migration" where "Classname" is the classname of the migration class. The files have to to be in a corresponding bundle. Implement "migrationBundleName" to return the correct name of the bundle.

This makes migrations easier as you only have to create a new Java class according to the migration naming conventions, inherit from this class and put your SQL in a properly named text file (or more than one file, if you use database specific migrations).

If you need database specific migrations use

er.extensions.migration.ERXMigration.useDatabaseSpecificMigrations=true

in your Properties. The default is not to use database specific migrations. A filename for a database specific migration is then for example

ClassnameX_FrontBase_Upgrade.migration or

ClassnameX_Postgresql_Upgrade.migration

For the database specific part of the filename, the databaseProductName as from the JDBC adaptor is used. So make sure, you're using the correct filename. The migration will throw an exception if the appropriate migration textfile can't be found.

Author:
cug

Constructor & Destructor Documentation

ERXMigration ( boolean  useDatabaseSpecificMigrations  ) 

Override the global application preference on per-database migrations.

Parameters:
useDatabaseSpecificMigrations if true, database-specific migrations will be used

ERXMigration (  ) 


Member Function Documentation

void downgrade ( EOEditingContext  editingContext,
EOAdaptorChannel  channel,
EOModel  model 
) throws Throwable

Checks for a corresponding downgrade file which is performed as a raw SQL action

Implements IERXMigration.

String getSQLForMigration ( String  migrationName  )  [protected]

Checks in the current bundle for migration files corresponding to this classes name

Parameters:
migrationName 

String migrationBundleName (  )  [protected]

The name to create the NSBundle for the current bundle, defaults to the bundle that contains the migration class.

NSArray<ERXModelVersion> modelDependencies (  ) 

No dependencies

Implements IERXMigration.

void upgrade ( EOEditingContext  editingContext,
EOAdaptorChannel  channel,
EOModel  model 
) throws Throwable

Checks for a corresponding upgrade file which is performed as a raw SQL action

Implements IERXMigration.

boolean useDatabaseSpecificMigrations (  )  [protected]


Member Data Documentation

Boolean _useDatabaseSpecificMigrations [private]

Logger log = Logger.getLogger(ERXMigration.class.getName()) [private]

Logging support


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:16 2012 for Project Wonder by  doxygen 1.5.8