AggregateRef

data class AggregateRef(val type: AggregateType, val tenantId: String, val id: String)

The identity of one aggregate instance: its type, its tenant and its id. Decided once, at admission; every unique key in the log includes the tenant (axiom A6), so two tenants may use the same id without meeting.

A creation command may name no id yet, its ref's id UNASSIGNED: admission gives it the id of the aggregate its request already created, or a new one from the aggregate type's generator. Committed ids never change.

Constructors

Link copied to clipboard
constructor(type: AggregateType, tenantId: String, id: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val id: String
Link copied to clipboard

Whether the id is chosen: not UNASSIGNED.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String

context.aggregate/tenant/id, each name with its separators and % percent-escaped (Escapes): % and / in each, and . in the context. A ref whose names hold none of them reads as they are, and no two refs share a text, so the published texts built on it (an envelope's id, a topic message's key, an execution's invocation key) name one aggregate each.