Class AnnotationBasedEntityIdResolver<T>
java.lang.Object
org.axonframework.modelling.annotation.AnnotationBasedEntityIdResolver<T>
- Type Parameters:
T- The type of the identifier to resolve.
- All Implemented Interfaces:
EntityIdResolver<T>
Implementation of a
EntityIdResolver that inspects the payload of a Message for fields or methods
annotated with TargetEntityId.
Multiple fields may be annotated, but only exactly one must resolve one distinct non-null value.
If no ids or multiple ids are found, an EntityIdResolutionException is thrown.
For performance reasons, the resolved identifier members are cached per payload type.
- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolve(Message message, ProcessingContext context) Resolve the id of the entity from the givenmessageandcontext.
-
Constructor Details
-
AnnotationBasedEntityIdResolver
public AnnotationBasedEntityIdResolver()
-
-
Method Details
-
resolve
@Nonnull public T resolve(@Nonnull Message message, @Nonnull ProcessingContext context) throws EntityIdResolutionException Description copied from interface:EntityIdResolverResolve the id of the entity from the givenmessageandcontext.- Specified by:
resolvein interfaceEntityIdResolver<T>- Parameters:
message- The message to resolve the id from.context- The context in which the message is processed.- Returns:
- The id of the entity.
- Throws:
EntityIdResolutionException- When the id could not be resolved.
-