public interface MultiTenantCapableDatastore<T, S extends ConnectionSourceSettings> extends ConnectionSourcesProvider, Datastore
An implementation that is capable of multi tenancy
Type Params | Return Type | Name and description |
---|---|---|
|
public Datastore |
getDatastoreForTenantId(java.io.Serializable tenantId) Obtains the datastore for the given tenant id. |
|
public MultiTenancyMode |
getMultiTenancyMode()
|
|
public TenantResolver |
getTenantResolver()
|
<T1> |
public T1 |
withNewSession(java.io.Serializable tenantId, groovy.lang.Closure<T1> callable) Execute a new session with the given tenantId IF the session is not already present. |
Methods inherited from class | Name |
---|---|
interface ConnectionSourcesProvider |
getConnectionSources |
interface Datastore |
connect, getApplicationContext, getApplicationEventPublisher, getCurrentSession, getMappingContext, hasCurrentSession, isSchemaless, withSession |
interface ServiceRegistry |
getService, getServices |
Obtains the datastore for the given tenant id. In SINGLE mode this will be a unique datastore for each tenant. For MULTI mode a single datastore is used for all tenants
tenantId
- The tenant id
Execute a new session with the given tenantId IF the session is not already present. This differs from the regular withNewSession method. The idea is that if there is already a transaction or session bound for the current tenant it should be re-used, otherwise one should be created
tenantId
- The tenant idcallable
- the callableT1
- the return type