public class AnnotationCommandTargetResolver extends Object implements CommandTargetResolver
TargetAggregateIdentifier. If on a method, the result of the invocation of that method will used as Aggregate Identifier. If on a field, the value held in that field is used. Similarly, the expected aggregate version may be provided by annotating a method (without parameters) or field with
TargetAggregateVersion. The return value of the method or value held in the field is used as the expected version. Note that the method must return a Long value, or a value that may be parsed as a Long.
|Modifier and Type||Class and Description|
Builder class to instantiate a
|Modifier||Constructor and Description|
Please use the
|Modifier and Type||Method and Description|
Instantiate a Builder to be able to create a
Returns the Aggregate Identifier and optionally the expected version of the aggregate on which the given
@Deprecated public AnnotationCommandTargetResolver()
protected AnnotationCommandTargetResolver(AnnotationCommandTargetResolver.Builder builder)
AnnotationCommandTargetResolverbased on the fields contained in the
AnnotationCommandTargetResolver.Builderused to instantiate a
public static final AnnotationCommandTargetResolver.Builder builder()
The TargetAggregateIdentifierAnnotation is defaulted to
public VersionedAggregateIdentifier resolveTarget(CommandMessage<?> command)
commandshould be executed. The version may be
nullif no specific version is required.
command- The command from which to extract the identifier and version
VersionedAggregateIdentifierinstance reflecting the aggregate to execute the command on
Copyright © 2010–2022. All rights reserved.