Skip to content

Annotations

Marks a data class as a Chronicle event type.

ParameterTypeDefaultDescription
idString""Stable identifier. Defaults to class name.
generationInt1Schema version. Increment when shape changes.
tombstoneBooleanfalseSignals event source retirement.
@EventType
data class OrderPlaced(val orderId: String, val totalAmount: Double)

Omitting id is the common case — Chronicle uses OrderPlaced as the identifier automatically.


Marks a class as a Chronicle reactor. Each public method becomes a handler for the event type of its first parameter.

ParameterTypeDefaultDescription
idString""Stable identifier. Defaults to class name.
@Reactor
class OrderNotifications { ... }

Supply an explicit id only when you need the identifier to survive class renames.


Marks a class as a reducer. Each public method folds one event type into the read model.

ParameterTypeDefaultDescription
idString""Stable identifier. Defaults to class name.
@Reducer
class OrderSummaryReducer { ... }

Marks a data class as a Chronicle read model.

ParameterTypeDefaultDescription
idString""Stable identifier. Defaults to class name.
displayNameString""Human-readable label. Defaults to name.
@ReadModel
data class OrderSummary(val orderId: String = "", val status: String = "pending")

Marks a class as a Chronicle projection. The class must implement IProjectionFor<T> or be used with declarative field annotations.

ParameterTypeDefaultDescription
idString""Stable identifier. Defaults to class name.
readModelKClass<*>Any::classFrom IProjectionFor<T>

Marks a class as a Chronicle constraint definition. The class must implement IConstraint.

ParameterTypeDefaultDescription
idString""Stable identifier. Defaults to class name.

Marks a class as a Chronicle event seeder. The class must implement ICanSeedEvents.


Marks a property as personally identifiable information. Chronicle encrypts annotated fields at rest using a per-subject key. See PII Attribute for the full compliance model this participates in.

@EventType
data class CustomerRegistered(
val customerId: String,
@Pii val email: String
)

Applied to a read model class to declare that its fields are mapped from an event type. Part of the annotation-based projection style.

ParameterTypeDescription
eventTypeKClass<*>The source event class.
keyStringEvent property key. Default: "EventSourceId".

Applied to a read model property to declare which event field populates it.

ParameterTypeDescription
propertyPathStringEvent field name. Defaults to the property name.