StaticTenantId

annotation class StaticTenantId(val tenantId: String = TenantId.DEFAULT_TENANT_ID)

Specifies a static tenant ID for classes that belong to a fixed tenant.

This annotation is used for aggregates or components that are permanently associated with a specific tenant, eliminating the need for dynamic tenant resolution.

Example usage:

@AggregateRoot
@StaticTenantId("system-tenant") // Always belongs to system tenant
class SystemConfigurationAggregate {

@OnCommand
fun updateGlobalSettings(command: UpdateSettingsCommand) {
// System-wide configuration changes
}
}

Parameters

tenantId

The fixed tenant identifier. Defaults to TenantId.DEFAULT_TENANT_ID.

See also

for dynamic tenant identification

Properties

Link copied to clipboard