Class SQLServerSchema
- java.lang.Object
-
- migratedb.v1.core.internal.database.base.BaseSchema
-
- migratedb.v1.core.internal.database.sqlserver.SQLServerSchema
-
- All Implemented Interfaces:
Schema
- Direct Known Subclasses:
SynapseSchema
public class SQLServerSchema extends BaseSchema
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSQLServerSchema.DBObjectSQL Server object meta-data.protected static classSQLServerSchema.ObjectTypeSQL Server object types for which we support automatic clean-up.
-
Field Summary
Fields Modifier and Type Field Description protected StringdatabaseName-
Fields inherited from class migratedb.v1.core.internal.database.base.BaseSchema
jdbcTemplate, name
-
-
Constructor Summary
Constructors Constructor Description SQLServerSchema(JdbcTemplate jdbcTemplate, SQLServerDatabase database, String databaseName, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<? extends SQLServerTable>doAllTables()Retrieves all the tables in this schema.protected booleandoCheckIfEmpty()Checks whether this schema is empty.protected voiddoCreate()Creates this schema in the database.protected booleandoExists()Checks whether this schema exists.protected SQLServerDatabasegetDatabase()SQLServerTablegetTable(String tableName)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.
-
-
-
Field Detail
-
databaseName
protected final String databaseName
-
-
Constructor Detail
-
SQLServerSchema
public SQLServerSchema(JdbcTemplate jdbcTemplate, SQLServerDatabase database, String databaseName, String name)
-
-
Method Detail
-
doExists
protected boolean doExists() throws SQLExceptionDescription copied from class:BaseSchemaChecks whether this schema exists.- Specified by:
doExistsin classBaseSchema- Throws:
SQLException- when the check failed.
-
doCheckIfEmpty
protected boolean doCheckIfEmpty() throws SQLExceptionDescription copied from class:BaseSchemaChecks whether this schema is empty.- Specified by:
doCheckIfEmptyin classBaseSchema- Throws:
SQLException- when the check failed.
-
doCreate
protected void doCreate() throws SQLExceptionDescription copied from class:BaseSchemaCreates this schema in the database.- Specified by:
doCreatein classBaseSchema- Throws:
SQLException- when the creation 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.
-
doAllTables
protected List<? extends SQLServerTable> doAllTables() throws SQLException
Description copied from class:BaseSchemaRetrieves all the tables in this schema.- Specified by:
doAllTablesin classBaseSchema- Throws:
SQLException- when the retrieval failed.
-
getDatabase
protected SQLServerDatabase getDatabase()
- Overrides:
getDatabasein classBaseSchema
-
getTable
public SQLServerTable getTable(String tableName)
Description copied from interface:SchemaRetrieves the table with this name in this schema.
-
-