AggregateRoot

open class AggregateRoot<Id : EntityId<*>>(id: Id) : Entity<Id>

Base class for aggregate roots in Domain-Driven Design.

An aggregate root is the entry point to an aggregate cluster and is responsible for maintaining invariants within its aggregate boundary.

Parameters

id

the unique domain identifier.

Type Parameters

Id

the type of the aggregate root identifier (must extend EntityId).

Constructors

Link copied to clipboard
constructor(id: Id)

Properties

Link copied to clipboard
open val id: Id

the unique domain identifier of this entity.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares two Entity instances based on their identifiers.

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

Generates a hash code based on the entity identifier.