@Documented @Retention(value=RUNTIME) @Target(value={ANNOTATION_TYPE,METHOD,FIELD}) public @interface EntityId
Field
or Method
annotation that marks the member containing the
identifier of an Entity. Commands for a child Entity are routed to the Entity if the value of the Command's routingKey()
property matches the value of the annotated field.Modifier and Type | Optional Element and Description |
---|---|
String |
routingKey
Get the name of the routing key property on commands and events that provides the identifier that should be used
to target the entity with the annotated member.
|
public abstract String routingKey
Optional. If left empty this defaults to the member name. If the member was named in a "getter" style, the "get"
will be removed.
Setting the routingKey
is especially useful for annotated Method
s, which
typically have a different naming scheme than a field in a command/event.
Copyright © 2010–2024. All rights reserved.