Class MultiTenantConnectionProviderImpl
- java.lang.Object
-
- br.com.damsete.multitenant.hibernate.MultiTenantConnectionProviderImpl
-
- All Implemented Interfaces:
Serializable,org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider,org.hibernate.service.Service,org.hibernate.service.spi.Wrapped
@Component public class MultiTenantConnectionProviderImpl extends Object implements org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultiTenantConnectionProviderImpl(DataSource dataSource)
-
Method Summary
Modifier and Type Method Description ConnectiongetAnyConnection()ConnectiongetConnection(String tenantIdentifier)booleanisUnwrappableAs(Class unwrapType)voidreleaseAnyConnection(Connection connection)voidreleaseConnection(String tenantIdentifier, Connection connection)booleansupportsAggressiveRelease()<T> Tunwrap(Class<T> unwrapType)
-
-
-
Constructor Detail
-
MultiTenantConnectionProviderImpl
@Autowired public MultiTenantConnectionProviderImpl(DataSource dataSource)
-
-
Method Detail
-
getAnyConnection
public Connection getAnyConnection() throws SQLException
- Specified by:
getAnyConnectionin interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider- Throws:
SQLException
-
releaseAnyConnection
public void releaseAnyConnection(Connection connection) throws SQLException
- Specified by:
releaseAnyConnectionin interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider- Throws:
SQLException
-
getConnection
public Connection getConnection(String tenantIdentifier) throws SQLException
- Specified by:
getConnectionin interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider- Throws:
SQLException
-
releaseConnection
public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException
- Specified by:
releaseConnectionin interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider- Throws:
SQLException
-
isUnwrappableAs
public boolean isUnwrappableAs(Class unwrapType)
- Specified by:
isUnwrappableAsin interfaceorg.hibernate.service.spi.Wrapped
-
unwrap
public <T> T unwrap(Class<T> unwrapType)
- Specified by:
unwrapin interfaceorg.hibernate.service.spi.Wrapped
-
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
- Specified by:
supportsAggressiveReleasein interfaceorg.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider
-
-