Package com.totvs.tjf.tenant.schema
Class SchemaConnectionProvider
- java.lang.Object
-
- com.totvs.tjf.tenant.schema.SchemaConnectionProvider
-
- All Implemented Interfaces:
Serializable
,org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
,org.hibernate.service.Service
,org.hibernate.service.spi.Wrapped
@Component public class SchemaConnectionProvider extends Object implements org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SchemaConnectionProvider(DataSource dataSource, com.totvs.tjf.migration.FlywayMigrationProperties properties, com.totvs.tjf.migration.FlywayMigrationService migration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
getAnyConnection()
Connection
getConnection(String tenantIdentifier)
boolean
isUnwrappableAs(Class unwrapType)
void
releaseAnyConnection(Connection connection)
void
releaseConnection(String tenantIdentifier, Connection connection)
boolean
supportsAggressiveRelease()
<T> T
unwrap(Class<T> unwrapType)
-
-
-
Constructor Detail
-
SchemaConnectionProvider
public SchemaConnectionProvider(DataSource dataSource, @Nullable com.totvs.tjf.migration.FlywayMigrationProperties properties, @Nullable com.totvs.tjf.migration.FlywayMigrationService migration)
-
-
Method Detail
-
getAnyConnection
public Connection getAnyConnection() throws SQLException
- Specified by:
getAnyConnection
in interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
- Throws:
SQLException
-
releaseAnyConnection
public void releaseAnyConnection(Connection connection) throws SQLException
- Specified by:
releaseAnyConnection
in interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
- Throws:
SQLException
-
getConnection
public Connection getConnection(String tenantIdentifier) throws SQLException
- Specified by:
getConnection
in interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
- Throws:
SQLException
-
releaseConnection
public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException
- Specified by:
releaseConnection
in interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
- Throws:
SQLException
-
isUnwrappableAs
public boolean isUnwrappableAs(Class unwrapType)
- Specified by:
isUnwrappableAs
in interfaceorg.hibernate.service.spi.Wrapped
-
unwrap
public <T> T unwrap(Class<T> unwrapType)
- Specified by:
unwrap
in interfaceorg.hibernate.service.spi.Wrapped
-
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
- Specified by:
supportsAggressiveRelease
in interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
-
-