Annotation Interface Aggregate


@Target({TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Component @Scope("prototype") @AggregateRoot public @interface Aggregate
Annotation that informs Axon's auto configurer for Spring that a given Component is an aggregate instance.
Since:
3.0
Author:
Allard Buijze
  • Element Details

    • repository

      String repository
      Selects the name of the AggregateRepository bean. If left empty a new repository is created. In that case the name of the repository will be based on the simple name of the aggregate's class.
      Default:
      ""
    • snapshotTriggerDefinition

      String snapshotTriggerDefinition
      Sets the name of the bean providing the snapshot trigger definition. If none is provided, no snapshots are created, unless explicitly configured on the referenced repository.

      Note that the use of repository(), or provisioning a Repository to the Spring context using the default naming scheme overrides this setting, as a Repository explicitly defines the snapshot trigger definition. The default name corresponds to "[aggregate-name]Repository", thus a Trade Aggregate would by default create/look for a bean named "tradeRepository".

      Default:
      ""
    • snapshotFilter

      String snapshotFilter
      Sets the name of the bean providing the SnapshotFilter. If none is provided, all snapshots will be taken into account unless explicitly configured on the event store.
      Default:
      ""
    • type

      String type
      Get the String representation of the aggregate's type. Optional. This defaults to the simple name of the annotated class.
      Default:
      ""
    • commandTargetResolver

      String commandTargetResolver
      Selects the name of the CommandTargetResolver bean. If left empty, CommandTargetResolver bean from application context will be used. If the bean is not defined in the application context, AnnotationCommandTargetResolver will be used.
      Default:
      ""
    • filterEventsByType

      boolean filterEventsByType
      Sets whether or not to filter events by Aggregate type. This is used to support installations where multiple Aggregate types can have overlapping Aggregate identifiers. This is only meaningful for event-sourced Aggregates.
      Default:
      false
    • cache

      String cache
      Sets the name of the bean providing the caching. If none is provided, no cache is created, unless explicitly configured on the referenced repository.

      Note that the use of repository(), or adding a Repository bean to the Spring context with the default naming scheme overrides this setting, as a Repository may explicitly define the cache. The default name corresponds to "[aggregate-name]Repository", thus a Trade Aggregate would by default create/look for a bean named "tradeRepository".

      Default:
      ""
    • lockFactory

      String lockFactory
      Sets the name of the bean providing the LockFactory. If none is provided, the Repository implementation's default is used, unless explicitly configured on the referenced repository.

      Note that the use of repository(), or adding a Repository bean to the Spring context with the default naming scheme overrides this setting, as a Repository explicitly defines the lock factory. The default name corresponds to "[aggregate-name]Repository", thus a Trade Aggregate would by default create/look for a bean named "tradeRepository".

      Default:
      ""