StaticAggregateId
Specifies a static aggregate ID for classes that represent single-instance aggregates.
This annotation is used for aggregates that have only one instance in the system, such as system-wide configuration aggregates or singleton services. The aggregate ID is fixed and doesn't change between instances.
Example usage:
@AggregateRoot
@StaticAggregateId("system-config")
class SystemConfigurationAggregate {
@OnCommand
fun updateConfig(command: UpdateConfigCommand): ConfigUpdated {
// Update system configuration
}
}Content copied to clipboard
Parameters
aggregateId
The static identifier for this aggregate type. All instances of the annotated class will share this same ID.
See also
for dynamic aggregate IDs