Annotation Interface CreationPolicy
@Documented
@Retention(RUNTIME)
@Target({METHOD,ANNOTATION_TYPE})
@HasHandlerAttributes
public @interface CreationPolicy
Annotation used to specify the creation policy for a command handler. Default behavior is that command handlers
defined on a constructor would create a new instance of the aggregate, and command handlers defined on other methods
expect an existing aggregate. This annotation provides the option to define policy
AggregateCreationPolicy.CREATE_IF_MISSING or AggregateCreationPolicy.ALWAYS on a command handler to create a
new instance of the aggregate from a handler operation.- Since:
- 4.3
- Author:
- Marc Gathier
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
AggregateCreationPolicy valueSpecifies theAggregateCreationPolicyto apply.NEVERwhen not set.- Returns:
- the creation policy
- Default:
NEVER
-