public abstract class KittyORMVersionMigrator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
AME_SEQUENCE_NOT_APPLICABLE |
protected android.content.Context |
context |
protected int |
currentVersion |
protected boolean |
logOn |
protected java.lang.String |
logTag |
protected KittyMigrationFactory |
migrationFactory |
protected java.util.LinkedList<KittyMigration> |
migrations |
protected int |
oldVersion |
protected java.lang.String |
schemaName |
Constructor and Description |
---|
KittyORMVersionMigrator(int oldVersion,
int currentVersion,
android.content.Context ctx,
java.lang.String schemaName,
java.lang.String logTag,
boolean logOn,
java.lang.Object[] factoryParameters,
java.lang.Object[] migrationsParameters) |
Modifier and Type | Method and Description |
---|---|
protected abstract <T extends KittyMigrationFactory> |
getMigrationFactory(java.lang.Object... parameters)
Returns child depended migrations factory
|
java.util.LinkedList<KittyMigration> |
getMigrations()
Returns list of sorted migrations.
|
java.util.Iterator<KittyMigration> |
getMigrationsIterator()
Returns iterator for
migrations if migration sequence is applicable to current schema,
or null if not applicable. |
boolean |
isMigrationSequenceApplicable()
Returns true if migration sequence can be applied step by step from old to current databaseClass versions
|
protected void |
orderMigrationsList()
Orders migrations in
migrations list in ascending order by migration's minVersionLower field |
protected abstract void |
setMigrations(java.lang.Object... parameters)
Fills
migrations with migrationFactory |
protected abstract void |
setParameters(java.lang.Object[] factoryParameters,
java.lang.Object[] migrationsParameters) |
protected final java.util.LinkedList<KittyMigration> migrations
protected final KittyMigrationFactory migrationFactory
protected final int oldVersion
protected final int currentVersion
protected final java.lang.String schemaName
protected final java.lang.String logTag
protected final boolean logOn
protected final android.content.Context context
protected final java.lang.String AME_SEQUENCE_NOT_APPLICABLE
public KittyORMVersionMigrator(int oldVersion, int currentVersion, android.content.Context ctx, java.lang.String schemaName, java.lang.String logTag, boolean logOn, java.lang.Object[] factoryParameters, java.lang.Object[] migrationsParameters)
protected abstract void setParameters(java.lang.Object[] factoryParameters, java.lang.Object[] migrationsParameters)
protected abstract <T extends KittyMigrationFactory> T getMigrationFactory(java.lang.Object... parameters)
T
- protected abstract void setMigrations(java.lang.Object... parameters)
migrations
with migrationFactory
protected void orderMigrationsList()
migrations
list in ascending order by migration's minVersionLower fieldpublic boolean isMigrationSequenceApplicable()
public java.util.Iterator<KittyMigration> getMigrationsIterator()
migrations
if migration sequence is applicable to current schema,
or null if not applicable. If you wish to get migrations for debug or other purposes, use
getMigrations()
instead.public java.util.LinkedList<KittyMigration> getMigrations()
getMigrationsIterator()
for
applying migration sequence cause this method won't check whether migration sequence applicable
or not.