Package org.axonframework.eventsourcing
Class EntityMissingAfterFirstEventException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.axonframework.eventsourcing.EntityMissingAfterFirstEventException
- All Implemented Interfaces:
Serializable
Exception thrown by the
is
EventSourcedEntityFactory when the entity returned by
invalid reference
EventSourcedEntityFactory#create(Object, EventMessage)
null when calling it with a non-null
firstEventMessage during the EventSourcingRepository.load(Object, ProcessingContext) or
EventSourcingRepository.loadOrCreate(Object, ProcessingContext).
Returning a null entity in this case indicates that the factory is incapable of creating an entity when
provided an EventMessage, which violates the contract of the EventSourcedEntityFactory.
Ensure that the factory is capable of creating an entity when provided with an event message.
- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEntityMissingAfterFirstEventException(Object identifier) Constructs the exception with the givenidentifier. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EntityMissingAfterFirstEventException
Constructs the exception with the givenidentifier.- Parameters:
identifier- The identifier of the entity that was attempted to be loaded or created.
-