A Service with utility methods for working with Multi-Tenancy
Type Params | Return Type | Name and description |
---|---|---|
|
java.io.Serializable |
currentId() @return The current tenant id |
|
void |
eachTenant(groovy.lang.Closure callable) Execute the given closure for each tenant. |
<T> |
T |
withCurrent(groovy.lang.Closure<T> callable) Execute the given closure with the current tenant |
<T> |
T |
withId(java.io.Serializable tenantId, groovy.lang.Closure<T> callable) Execute the given closure with given tenant id |
<T> |
T |
withoutId(groovy.lang.Closure<T> callable) Execute the given closure without any tenant id. |
Execute the given closure for each tenant.
callable
- The closureExecute the given closure with the current tenant
callable
- The closureExecute the given closure with given tenant id
tenantId
- The tenant idcallable
- The closureExecute the given closure without any tenant id. In Multi tenancy mode SINGLE this will execute against the default data source. If multi tenancy mode MULTI this will execute without including the "tenantId" on any query. Use with caution.
callable
- The closure