Interface Session
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BaseSession,BigQuerySession,CockroachDBSession,DB2Session,DerbySession,FirebirdSession,H2Session,HSQLDBSession,IgniteThinSession,InformixSession,MySQLSession,OracleSession,PostgreSQLSession,RedshiftSession,SAPHANASession,SnowflakeSession,SpannerSession,SQLiteSession,SQLServerSession,SybaseASESession,SynapseSession,TiDBSession,YugabyteDBSession
public interface Session extends AutoCloseable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidchangeCurrentSchemaTo(Schema schema)Sets the current schema, which is the default owner of new database objects.voidclose()SchemagetCurrentSchema()Retrieves the current schema, which is the default owner of new database objects.ConnectiongetJdbcConnection()JdbcTemplategetJdbcTemplate()SchemagetSchema(String name)Retrieves the schema with this name in the database.<T> Tlock(Table table, Callable<T> callable)Locks this table and executes this callable.voidrestoreOriginalState()Undoes all changes to database settings and variables whose scope is bound to the lifetime of the JDBC connection.
-
-
-
Method Detail
-
getCurrentSchema
Schema getCurrentSchema()
Retrieves the current schema, which is the default owner of new database objects. In many databases, the current schema is also used to lookup tables whenever the schema qualifier is omitted.
-
changeCurrentSchemaTo
void changeCurrentSchemaTo(Schema schema)
Sets the current schema, which is the default owner of new database objects. In many databases, the current schema is also used to lookup tables whenever the schema qualifier is omitted.
-
lock
<T> T lock(Table table, Callable<T> callable)
Locks this table and executes this callable.- Returns:
- The result of the callable.
-
getJdbcTemplate
JdbcTemplate getJdbcTemplate()
-
restoreOriginalState
void restoreOriginalState()
Undoes all changes to database settings and variables whose scope is bound to the lifetime of the JDBC connection. An example of such state is thesearch_pathsetting of PostgreSQL. Methods that may change state are:Will only undo changes that have been made through this object. Changes made by migration scripts are not accounted for.
-
getJdbcConnection
Connection getJdbcConnection()
-
close
void close()
- Specified by:
closein interfaceAutoCloseable
-
-