Class EntityNotFoundException

All Implemented Interfaces:
Serializable

public class EntityNotFoundException extends AxonNonTransientException
Exception indicating that an entity could not be found in, or recreated by, the Repository.

A missing entity is definitionally non-transient: retrying the same operation will not make the entity appear. As an AxonNonTransientException, this is reflected in retry policies and dead-letter classification via ExceptionUtils.isExplicitlyNonTransient(Throwable).

Since:
0.4.0
Author:
Allard Buijze, Steven van Beelen
See Also:
  • Constructor Details

    • EntityNotFoundException

      public EntityNotFoundException(Object identifier)
      Initialize an EntityNotFoundException for being unable to load an entity with the given identifier.
      Parameters:
      identifier - the identifier of the entity that could not be found
    • EntityNotFoundException

      public EntityNotFoundException(Object identifier, String message)
      Initialize an EntityNotFoundException for being unable to load an entity with the given identifier, using the given message as the Throwable.getMessage().
      Parameters:
      identifier - the identifier of the entity that could not be found
      message - the message describing the cause of the exception
    • EntityNotFoundException

      public EntityNotFoundException(Object identifier, String message, Throwable cause)
      Initialize an EntityNotFoundException for being unable to load an entity with the given identifier, using the given message as the Throwable.getMessage() and the given cause as the Throwable.getCause().
      Parameters:
      identifier - the identifier of the entity that could not be found
      message - the message describing the cause of the exception
      cause - the underlying cause of the exception
  • Method Details

    • identifier

      public Object identifier()
      Returns the identifier of the entity that could not be found.
      Returns:
      the identifier of the entity that could not be found