类 HerodotusTenantIdentifierResolver
java.lang.Object
cn.herodotus.stirrup.data.hibernate.tenant.HerodotusTenantIdentifierResolver
- 所有已实现的接口:
org.hibernate.context.spi.CurrentTenantIdentifierResolver<String>,org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer
@Component
public class HerodotusTenantIdentifierResolver
extends Object
implements org.hibernate.context.spi.CurrentTenantIdentifierResolver<String>, org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer
Description: 租户选择器
数据库请求发生时,应该使用哪个租户的连接信息。使用 CurrentTenantIdentifierResolver (租户ID解析器)接口获取这一信息
- 作者:
- : gengwei.zheng
- Date:
- : 2022/9/8 18:14
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidbooleanAdditionally, if the CurrentTenantIdentifierResolver implementation returns true for its validateExistingCurrentSessions method, Hibernate will make sure any existing sessions that are found in scope have a matching tenant identifier.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.hibernate.context.spi.CurrentTenantIdentifierResolver
isRoot
-
构造器详细资料
-
HerodotusTenantIdentifierResolver
public HerodotusTenantIdentifierResolver()
-
-
方法详细资料
-
resolveCurrentTenantIdentifier
- 指定者:
resolveCurrentTenantIdentifier在接口中org.hibernate.context.spi.CurrentTenantIdentifierResolver<String>
-
validateExistingCurrentSessions
public boolean validateExistingCurrentSessions()Additionally, if the CurrentTenantIdentifierResolver implementation returns true for its validateExistingCurrentSessions method, Hibernate will make sure any existing sessions that are found in scope have a matching tenant identifier. This capability is only pertinent when the CurrentTenantIdentifierResolver is used in current-session settings.- 指定者:
validateExistingCurrentSessions在接口中org.hibernate.context.spi.CurrentTenantIdentifierResolver<String>- 返回:
- 确保已经存在的 Session 都有一个对应的 Tenant ID
-
customize
- 指定者:
customize在接口中org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer
-