Class SQLServerSchema
java.lang.Object
migratedb.v1.core.internal.database.base.BaseSchema<SQLServerDatabase,SQLServerTable>
migratedb.v1.core.internal.database.sqlserver.SQLServerSchema
- All Implemented Interfaces:
Schema<SQLServerDatabase,SQLServerTable>
- Direct Known Subclasses:
SynapseSchema
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSQL Server object meta-data.protected static enumSQL Server object types for which we support automatic clean-up. -
Field Summary
FieldsFields inherited from class migratedb.v1.core.internal.database.base.BaseSchema
database, jdbcTemplate, name -
Constructor Summary
ConstructorsConstructorDescriptionSQLServerSchema(JdbcTemplate jdbcTemplate, SQLServerDatabase database, String databaseName, String name) -
Method Summary
Modifier and TypeMethodDescriptioncleanObjects(String dropQualifier, SQLServerSchema.ObjectType... objectTypes) protected SQLServerTable[]Retrieves all the tables in this schema.protected voiddoClean()Cleans all the objects in this schema.protected voiddoCreate()Creates this schema in the database.protected voiddoDrop()Drops this schema from the database.protected booleandoEmpty()Checks whether this schema is empty.protected booleandoExists()Checks whether this schema exists.Table<?,?> Retrieves the table with this name in this schema.protected List<SQLServerSchema.DBObject>queryDBObjects(SQLServerSchema.ObjectType... types) Query objects with any of the given types.Methods inherited from class migratedb.v1.core.internal.database.base.BaseSchema
allFunctions, allTables, allTypes, clean, create, doAllFunctions, drop, empty, equals, exists, getFunction, getName, getType, hashCode, toString
-
Field Details
-
databaseName
-
-
Constructor Details
-
SQLServerSchema
public SQLServerSchema(JdbcTemplate jdbcTemplate, SQLServerDatabase database, String databaseName, String name)
-
-
Method Details
-
doExists
Description copied from class:BaseSchemaChecks whether this schema exists.- Specified by:
doExistsin classBaseSchema<SQLServerDatabase,SQLServerTable> - Throws:
SQLException- when the check failed.
-
doEmpty
Description copied from class:BaseSchemaChecks whether this schema is empty.- Specified by:
doEmptyin classBaseSchema<SQLServerDatabase,SQLServerTable> - Throws:
SQLException- when the check failed.
-
doCreate
Description copied from class:BaseSchemaCreates this schema in the database.- Specified by:
doCreatein classBaseSchema<SQLServerDatabase,SQLServerTable> - Throws:
SQLException- when the creation failed.
-
doDrop
Description copied from class:BaseSchemaDrops this schema from the database.- Specified by:
doDropin classBaseSchema<SQLServerDatabase,SQLServerTable> - Throws:
SQLException- when the drop failed.
-
doClean
Description copied from class:BaseSchemaCleans all the objects in this schema.- Specified by:
doCleanin classBaseSchema<SQLServerDatabase,SQLServerTable> - Throws:
SQLException- when the clean failed.
-
queryDBObjects
protected List<SQLServerSchema.DBObject> queryDBObjects(SQLServerSchema.ObjectType... types) throws SQLException Query objects with any of the given types.- Parameters:
types- The object types to be queried.- Returns:
- The found objects.
- Throws:
SQLException- when the retrieval failed.
-
cleanTriggers
- Returns:
- The drop statements.
- Throws:
SQLException- when the clean statements could not be generated.
-
cleanSynonyms
- Returns:
- The drop statements.
- Throws:
SQLException- when the clean statements could not be generated.
-
cleanRules
- Returns:
- The drop statements.
- Throws:
SQLException- when the clean statements could not be generated.
-
cleanObjects
protected List<String> cleanObjects(String dropQualifier, SQLServerSchema.ObjectType... objectTypes) throws SQLException - Parameters:
dropQualifier- The type of DROP statement to issue.objectTypes- The type of objects to drop.- Returns:
- The drop statements.
- Throws:
SQLException- when the clean statements could not be generated.
-
doAllTables
Description copied from class:BaseSchemaRetrieves all the tables in this schema.- Specified by:
doAllTablesin classBaseSchema<SQLServerDatabase,SQLServerTable> - Throws:
SQLException- when the retrieval failed.
-
getTable
Description copied from interface:SchemaRetrieves the table with this name in this schema.
-