类 AbstractDataSourceBasedMultiTenantConnectionProviderImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.connections.spi.AbstractDataSourceBasedMultiTenantConnectionProviderImpl
-
- 所有已实现的接口:
Serializable,MultiTenantConnectionProvider,Service,Wrapped
public abstract class AbstractDataSourceBasedMultiTenantConnectionProviderImpl extends Object implements MultiTenantConnectionProvider
Basic support for implementations ofMultiTenantConnectionProviderbased on DataSources.- 作者:
- Steve Ebersole
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 AbstractDataSourceBasedMultiTenantConnectionProviderImpl()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 ConnectiongetAnyConnection()Allows access to the database metadata of the underlying database(s) in situations where we do not have a tenant id (like startup processing, for example).ConnectiongetConnection(String tenantIdentifier)Obtains a connection for Hibernate use according to the underlying strategy of this provider.booleanisUnwrappableAs(Class unwrapType)Can this wrapped service be unwrapped as the indicated type?voidreleaseAnyConnection(Connection connection)Release a connection obtained fromMultiTenantConnectionProvider.getAnyConnection()voidreleaseConnection(String tenantIdentifier, Connection connection)Release a connection from Hibernate use.protected abstract DataSourceselectAnyDataSource()protected abstract DataSourceselectDataSource(String tenantIdentifier)booleansupportsAggressiveRelease()Does this connection provider support aggressive release of JDBC connections and re-acquisition of those connections (if need be) later?<T> Tunwrap(Class<T> unwrapType)Unproxy the service proxy
-
-
-
方法详细资料
-
selectAnyDataSource
protected abstract DataSource selectAnyDataSource()
-
selectDataSource
protected abstract DataSource selectDataSource(String tenantIdentifier)
-
getAnyConnection
public Connection getAnyConnection() throws SQLException
从接口复制的说明:MultiTenantConnectionProviderAllows access to the database metadata of the underlying database(s) in situations where we do not have a tenant id (like startup processing, for example).- 指定者:
getAnyConnection在接口中MultiTenantConnectionProvider- 返回:
- The database metadata.
- 抛出:
SQLException- Indicates a problem opening a connection
-
releaseAnyConnection
public void releaseAnyConnection(Connection connection) throws SQLException
从接口复制的说明:MultiTenantConnectionProviderRelease a connection obtained fromMultiTenantConnectionProvider.getAnyConnection()- 指定者:
releaseAnyConnection在接口中MultiTenantConnectionProvider- 参数:
connection- The JDBC connection to release- 抛出:
SQLException- Indicates a problem closing the connection
-
getConnection
public Connection getConnection(String tenantIdentifier) throws SQLException
从接口复制的说明:MultiTenantConnectionProviderObtains a connection for Hibernate use according to the underlying strategy of this provider.- 指定者:
getConnection在接口中MultiTenantConnectionProvider- 参数:
tenantIdentifier- The identifier of the tenant for which to get a connection- 返回:
- The obtained JDBC connection
- 抛出:
SQLException- Indicates a problem opening a connection
-
releaseConnection
public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException
从接口复制的说明:MultiTenantConnectionProviderRelease a connection from Hibernate use.- 指定者:
releaseConnection在接口中MultiTenantConnectionProvider- 参数:
tenantIdentifier- The identifier of the tenant.connection- The JDBC connection to release- 抛出:
SQLException- Indicates a problem closing the connection
-
supportsAggressiveRelease
public boolean supportsAggressiveRelease()
从接口复制的说明:MultiTenantConnectionProviderDoes this connection provider support aggressive release of JDBC connections and re-acquisition of those connections (if need be) later? This is used in conjunction withAvailableSettings.RELEASE_CONNECTIONSto aggressively release JDBC connections. However, the configured ConnectionProvider must support re-acquisition of the same underlying connection for that semantic to work. Typically, this is only true in managed environments where a container tracks connections by transaction or thread. Note that JTA semantic depends on the fact that the underlying connection provider does support aggressive release.- 指定者:
supportsAggressiveRelease在接口中MultiTenantConnectionProvider- 返回:
trueif aggressive releasing is supported;falseotherwise.
-
isUnwrappableAs
public boolean isUnwrappableAs(Class unwrapType)
从接口复制的说明:WrappedCan this wrapped service be unwrapped as the indicated type?- 指定者:
isUnwrappableAs在接口中Wrapped- 参数:
unwrapType- The type to check.- 返回:
- True/false.
-
-