org.hibernate.context.spi
Interface CurrentTenantIdentifierResolver


public interface CurrentTenantIdentifierResolver

A callback registered with the SessionFactory that is responsible for resolving the current tenant identifier for use with CurrentSessionContext and SessionFactory.getCurrentSession()


Method Summary
 String resolveCurrentTenantIdentifier()
          Resolve the current tenant identifier.
 boolean validateExistingCurrentSessions()
          Should we validate that the tenant identifier on "current sessions" that already exist when CurrentSessionContext.currentSession() is called matches the value returned here from resolveCurrentTenantIdentifier()?
 

Method Detail

resolveCurrentTenantIdentifier

String resolveCurrentTenantIdentifier()
Resolve the current tenant identifier.

Returns:
The current tenant identifier

validateExistingCurrentSessions

boolean validateExistingCurrentSessions()
Should we validate that the tenant identifier on "current sessions" that already exist when CurrentSessionContext.currentSession() is called matches the value returned here from resolveCurrentTenantIdentifier()?

Returns:
true indicates that the extra validation will be performed; false indicates it will not.
See Also:
TenantIdentifierMismatchException


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.