Interface EntityModule<ID,E>

Type Parameters:
ID - The type of the entity's identifier.
E - The type of the entity.
All Superinterfaces:
Module
All Known Subinterfaces:
EventSourcedEntityModule<ID,E>, StateBasedEntityModule<ID,E>

public interface EntityModule<ID,E> extends Module
Module that builds an entity of type E with an identifier of type ID. This entity is then registered to the nearest parent StateManager with the created Repository.

Make sure to register this module with the parent module or configurer of your choice. Each entity should only have one module, and each module should only be registered once. As such, make sure to register it on the right level of your module hierarchy.

Since:
5.0.0
Author:
Steven van Beelen, Mitchell Herrijgers
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    The name of the entity, typically a concatenation of the entity type's simple name and the identifier type's simple name.
    Returns the type of the entity.
    Returns the type of the entity's identifier.

    Methods inherited from interface org.axonframework.common.configuration.Module

    build, name
  • Method Details

    • entityName

      default String entityName()
      The name of the entity, typically a concatenation of the entity type's simple name and the identifier type's simple name.

      The module should use this name for the components they register to the ComponentRegistry.

      Returns:
      The name of the entity.
    • idType

      Class<ID> idType()
      Returns the type of the entity's identifier.
      Returns:
      The type of the entity's identifier.
    • entityType

      Class<E> entityType()
      Returns the type of the entity.
      Returns:
      The type of the entity.