Annotation Interface EventSourced
@Target({TYPE,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Component
@Scope("prototype")
public @interface EventSourced
Annotation that informs Axon's auto configurer for Spring that a given
Component is an event-sourced entity instance.
This annotation is a meta-annotation of EventSourcedEntity allowing to put the configuration
directly.
- Since:
- 3.0
- Author:
- Allard Buijze, Simon Zambrovski
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]If the entity is a polymorphic entity, any subclasses that should be considered concrete types of the entity should be specified here.Class<? extends CriteriaResolverDefinition> The definition of theCriteriaResolverto use to resolve theEventCriteriafor the entity.Class<? extends EventSourcedEntityFactoryDefinition> The definition of theEventSourcedEntityFactoryto use to create a new instance of the entity.Class<? extends EntityIdResolverDefinition> The definition of theEntityIdResolverDefinitionto use to resolve the entity id from acommand message.Class<?> Get the Class of entity's id type, important for construction of theThe tag name to use when resolving theEventCriteriafor the entity.Get the String representation of the entity's type.
-
Element Details
-
type
String typeGet the String representation of the entity's type. Optional. This defaults to the simple name of the annotated class.- Returns:
- The type of the entity.
- Default:
""
-
idType
Class<?> idTypeGet the Class of entity's id type, important for construction of the- Returns:
- The class of the entity id.
- Default:
java.lang.String.class
-
tagKey
The tag name to use when resolving theEventCriteriafor the entity. If empty, the simple name of the entity class will be used.This value does not take effect if a matching
EventCriteriaBuilderis found, or a customcriteriaResolverDefinition()is provided.- Returns:
- The tag name to use when resolving the
EventCriteriafor the entity.
- Default:
""
-
concreteTypes
If the entity is a polymorphic entity, any subclasses that should be considered concrete types of the entity should be specified here. Classes that are not specified here will not be scanned.- Returns:
- The concrete types of the entity that should be considered when building the
AnnotatedEntityMetamodel.
- Default:
{}
-
criteriaResolverDefinition
@AliasFor(annotation=EventSourcedEntity.class, attribute="criteriaResolverDefinition") Class<? extends CriteriaResolverDefinition> criteriaResolverDefinitionThe definition of theCriteriaResolverto use to resolve theEventCriteriafor the entity. A custom definition can be provided to override the default behavior of theAnnotationBasedEventCriteriaResolver.- Returns:
- The definition to construct a
CriteriaResolverDefinition.
- Default:
org.axonframework.eventsourcing.annotation.AnnotationBasedEventCriteriaResolverDefinition.class
-
entityFactoryDefinition
@AliasFor(annotation=EventSourcedEntity.class, attribute="entityFactoryDefinition") Class<? extends EventSourcedEntityFactoryDefinition> entityFactoryDefinitionThe definition of theEventSourcedEntityFactoryto use to create a new instance of the entity. A custom definition can be provided to override the default behavior of theAnnotationBasedEventSourcedEntityFactoryDefinition.- Returns:
- The definition to construct an
EventSourcedEntityFactory.
- Default:
org.axonframework.eventsourcing.annotation.reflection.AnnotationBasedEventSourcedEntityFactoryDefinition.class
-
entityIdResolverDefinition
@AliasFor(annotation=EventSourcedEntity.class, attribute="entityIdResolverDefinition") Class<? extends EntityIdResolverDefinition> entityIdResolverDefinitionThe definition of theEntityIdResolverDefinitionto use to resolve the entity id from acommand message. Defaults to theAnnotatedEntityIdResolverDefinition, which resolves the entity id based on theTargetEntityIdannotation on a payload field or method, after converting the payload to the representation wanted by the entity.- Returns:
- The definition to construct an
EntityIdResolverDefinition.
- Default:
org.axonframework.modelling.entity.annotation.AnnotatedEntityIdResolverDefinition.class
-