java.lang.Object
org.tentackle.model.migrate.ColumnMigrator
Handles the migration of columns.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionColumnMigrator(Entity entity, Attribute attribute, Backend backend, Collection<ColumnMetaData> columns) Creates a column migrator.ColumnMigrator(Entity entity, Attribute attribute, Backend backend, ColumnMetaData... columns) Creates a column migrator. -
Method Summary
Modifier and TypeMethodDescriptionGets the model's attribute.Gets the backend.Gets the database's column meta data.migrate()Migrates the column.
-
Constructor Details
-
ColumnMigrator
public ColumnMigrator(Entity entity, Attribute attribute, Backend backend, ColumnMetaData... columns) Creates a column migrator.- Parameters:
entity- the migrated entityattribute- the model's attribute, null if drop columnsbackend- the backendcolumns- the database's column(s), null if add attribute
-
ColumnMigrator
public ColumnMigrator(Entity entity, Attribute attribute, Backend backend, Collection<ColumnMetaData> columns) Creates a column migrator.- Parameters:
entity- the migrated entityattribute- the model's attribute, null if drop columnsbackend- the backendcolumns- the database's column(s), null or empty if add attribute
-
-
Method Details
-
getBackend
Gets the backend.- Returns:
- the backend
-
getAttribute
Gets the model's attribute.- Returns:
- the model's attribute
-
getColumns
Gets the database's column meta data.- Returns:
- the database's column(s)
-
migrate
Migrates the column.- Returns:
- the SQL code, empty string if nothing to migrate
- Throws:
ModelException- if migration failed
-