- java.lang.Object
-
- org.tentackle.model.migrate.IndexMigrator
-
public class IndexMigrator extends java.lang.ObjectHandles the migration of indexes.- Author:
- harald
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIndexMigrator.ResultMigration result.
-
Constructor Summary
Constructors Constructor Description IndexMigrator(Entity entity, Index index, org.tentackle.sql.Backend backend, org.tentackle.sql.metadata.IndexMetaData indexMetaData)Creates a migrator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.tentackle.sql.BackendgetBackend()Gets the backend.IndexgetIndex()Gets the index to migrate.org.tentackle.sql.metadata.IndexMetaDatagetIndexMetaData()Gets the index metadata.IndexMigrator.Resultmigrate()Migrates the index.
-
-
-
Constructor Detail
-
IndexMigrator
public IndexMigrator(Entity entity, Index index, org.tentackle.sql.Backend backend, org.tentackle.sql.metadata.IndexMetaData indexMetaData)
Creates a migrator.- Parameters:
entity- the entityindex- the index to migrate, null if no such index in modelbackend- the backendindexMetaData- the foreign meta data, null if key does not exist
-
-
Method Detail
-
getBackend
public org.tentackle.sql.Backend getBackend()
Gets the backend.- Returns:
- the backend
-
getIndex
public Index getIndex()
Gets the index to migrate.- Returns:
- the index, null if no such index in model
-
getIndexMetaData
public org.tentackle.sql.metadata.IndexMetaData getIndexMetaData()
Gets the index metadata.- Returns:
- the meta date, null if no such index in database
-
migrate
public IndexMigrator.Result migrate()
Migrates the index.- Returns:
- the SQL code, empty string if nothing to migrate
-
-