@CompileStatic class GormApiResolver extends java.lang.Object
Instance-based resolver for GORM APIs and datastores.
| Constructor and description |
|---|
GormApiResolver(GormRegistry registry) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
Datastore |
findDatastore(java.lang.Class entity, java.lang.String qualifier) |
|
Datastore |
findDatastoreByType(java.lang.Class<? extends Datastore> datastoreType) |
|
PersistentEntity |
findEntity(java.lang.Class entity, java.lang.String qualifier) |
|
Datastore |
findServiceDatastore(java.lang.Class entity)Resolves the datastore for a tenant-management service lookup (e.g. the @CurrentTenant
TenantService) and the datastore that
Tenants.withId binds the tenant for. |
|
Datastore |
findSingleDatastore()The datastore of the default connection, the one that Tenants and @CurrentTenant bind the tenant for. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Resolves the datastore for a tenant-management service lookup (e.g. the @CurrentTenant
TenantService) and the datastore that
Tenants.withId binds the tenant for. Unlike
findDatastore, this never
resolves the current tenant: it returns the entity's primary (DEFAULT) datastore — the tenant
MANAGER, where runtime schemas (e.g. addTenantForSchema) are registered — rather than a
per-tenant child datastore. Falls back to the single configured datastore when the entity is
not mapped to a specific datastore.
The datastore of the default connection, the one that Tenants and
@CurrentTenant bind the tenant for. It is never a datastore of another connection or, in DATABASE mode,
of a tenant, even inside Tenants.withId or while a
session of one is bound: such a datastore knows only its own connection, and no tenant is bound for it.