Top Description Methods
org.hibernate.context.spi

public Interface CurrentTenantIdentifierResolver<T>


A callback registered with the org.hibernate.SessionFactory that is responsible for resolving the current tenant identifier.

An implementation may be selected by setting the configuration property hibernate.tenant_identifier_resolver.

Author
Steve Ebersole
See Also
org.hibernate.cfg.Configuration#setCurrentTenantIdentifierResolver, org.hibernate.boot.SessionFactoryBuilder#applyCurrentTenantIdentifierResolver, org.hibernate.annotations.TenantId, org.hibernate.cfg.AvailableSettings#MULTI_TENANT_IDENTIFIER_RESOLVER

Method Summary

Modifier and TypeMethod and Description
public default boolean

Returns:

true is this is root tenant
isRoot
(T
a tenant id produced by resolveCurrentTenantIdentifier()
tenantId
)

Does the given tenant id represent a "root" tenant with access to all partitions?

public T

Returns:

The current tenant identifier
resolveCurrentTenantIdentifier
()

Resolve the current tenant identifier.

public boolean

Returns:

true indicates that the extra validation will be performed; false indicates it will not.
validateExistingCurrentSessions
()

Should we validate that the tenant identifier of a "current sessions" that already exists when CurrentSessionContext#currentSession() is called matches the value returned here from resolveCurrentTenantIdentifier()?

Method Detail

isRootback to summary
public default boolean isRoot(T tenantId)

Does the given tenant id represent a "root" tenant with access to all partitions?

Parameters
tenantId:T

a tenant id produced by resolveCurrentTenantIdentifier()

Returns:boolean

true is this is root tenant

resolveCurrentTenantIdentifierback to summary
public T resolveCurrentTenantIdentifier()

Resolve the current tenant identifier.

Returns:T

The current tenant identifier

validateExistingCurrentSessionsback to summary
public boolean validateExistingCurrentSessions()

Should we validate that the tenant identifier of a "current sessions" that already exists when CurrentSessionContext#currentSession() is called matches the value returned here from resolveCurrentTenantIdentifier()?

Returns:boolean

true indicates that the extra validation will be performed; false indicates it will not.

See Also
org.hibernate.context.TenantIdentifierMismatchException