Class SQLServerSession
- java.lang.Object
-
- migratedb.v1.core.internal.database.base.BaseSession
-
- migratedb.v1.core.internal.database.sqlserver.SQLServerSession
-
- All Implemented Interfaces:
AutoCloseable,Session
- Direct Known Subclasses:
SynapseSession
public class SQLServerSession extends BaseSession
-
-
Field Summary
Fields Modifier and Type Field Description protected StringoriginalDatabaseName-
Fields inherited from class migratedb.v1.core.internal.database.base.BaseSession
jdbcTemplate, originalSchemaNameOrSearchPath
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSQLServerSession(SQLServerDatabase database, Connection connection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoRestoreOriginalState()protected StringgetCurrentSchemaNameOrSearchPath()SQLServerDatabasegetDatabase()SQLServerEngineEditiongetEngineEdition()SQLServerSchemagetSchema(String name)Retrieves the schema with this name in the database.BooleanisAzureConnection()<T> Tlock(Table table, Callable<T> callable)Locks this table and executes this callable.-
Methods inherited from class migratedb.v1.core.internal.database.base.BaseSession
changeCurrentSchemaTo, close, doChangeCurrentSchemaOrSearchPathTo, doGetCurrentSchema, getCurrentSchema, getJdbcConnection, getJdbcTemplate, restoreOriginalState
-
-
-
-
Field Detail
-
originalDatabaseName
protected final String originalDatabaseName
-
-
Constructor Detail
-
SQLServerSession
protected SQLServerSession(SQLServerDatabase database, Connection connection)
-
-
Method Detail
-
getCurrentSchemaNameOrSearchPath
protected String getCurrentSchemaNameOrSearchPath() throws SQLException
- Specified by:
getCurrentSchemaNameOrSearchPathin classBaseSession- Throws:
SQLException- when the current schema name or search path could not be retrieved.
-
doRestoreOriginalState
protected void doRestoreOriginalState() throws SQLException- Overrides:
doRestoreOriginalStatein classBaseSession- Throws:
SQLException
-
getSchema
public SQLServerSchema getSchema(String name)
Description copied from interface:SessionRetrieves the schema with this name in the database.
-
getDatabase
public SQLServerDatabase getDatabase()
- Overrides:
getDatabasein classBaseSession
-
lock
public <T> T lock(Table table, Callable<T> callable)
Description copied from interface:SessionLocks this table and executes this callable.- Specified by:
lockin interfaceSession- Overrides:
lockin classBaseSession- Returns:
- The result of the callable.
-
isAzureConnection
public Boolean isAzureConnection()
-
getEngineEdition
public SQLServerEngineEdition getEngineEdition()
-
-